Skip to content

Commit feafc7b

Browse files
author
Matt Dees
committed
Update spellcheck plugin
1 parent 7bb4838 commit feafc7b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/GeckBot/Plugins/SpellCheck.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,17 @@ sub suggest {
2323
sub check {
2424
my ( $self, $said_hr ) = @_;
2525
my $word = $said_hr->{'body'};
26-
return $speller->check( $word ) ? "$word is spelled ok" : "$word is not spelled ok";
26+
27+
my $response;
28+
29+
if ( $speller->check( $word ) ) {
30+
$response = '$word is spelled ok';
31+
}
32+
else {
33+
$response = "word is incorrect - " . join( ' ', $speller->suggest( $word ) );
34+
}
35+
36+
return $response;
2737
}
2838

2939
1;

0 commit comments

Comments
 (0)