diff options
-rw-r--r-- | bot.pl | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -33,6 +33,7 @@ my %commands = ( 'help' => \&francoise_help, | |||
33 | 'topten0r' => \&francoise_topten0r, | 33 | 'topten0r' => \&francoise_topten0r, |
34 | 'forget' => \&francoise_forget, | 34 | 'forget' => \&francoise_forget, |
35 | 'alias' => \&francoise_alias, | 35 | 'alias' => \&francoise_alias, |
36 | 'count' => \&francoise_count, | ||
36 | ); | 37 | ); |
37 | 38 | ||
38 | # this helps identify jamaica autorejoiner and doublejoiner | 39 | # this helps identify jamaica autorejoiner and doublejoiner |
@@ -387,6 +388,20 @@ sub francoise_forget { | |||
387 | } | 388 | } |
388 | } | 389 | } |
389 | 390 | ||
391 | sub francoise_count { | ||
392 | my ($kernel, $channel, $what) = @_; | ||
393 | |||
394 | my ($tmp) = $dbh->selectrow_array("SELECT COUNT(*) FROM knowledge where trigger = ?", undef, $what); | ||
395 | |||
396 | if ($tmp) | ||
397 | { | ||
398 | $kernel->post('francoise', 'privmsg', $channel, "Dazu hab ich $tmp schlaue Sachen zu sagen."); | ||
399 | } else | ||
400 | { | ||
401 | $kernel->post('francoise', 'privmsg', $channel, "Zu $what weiss ich noch gar nix."); | ||
402 | } | ||
403 | } | ||
404 | |||
390 | sub francoise_donothing { | 405 | sub francoise_donothing { |
391 | } | 406 | } |
392 | 407 | ||