summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkiffer <>2005-08-05 11:44:28 +0000
committerkiffer <>2005-08-05 11:44:28 +0000
commita2072392c6b8e2d5f2a61ed5ef23a7ba6d516904 (patch)
tree092ef3ab4898db68970d826ce351e5bcfbb76239
parent3f710d4a969eeeb9c6fcb8a231fdfd507028f67a (diff)
added "!count"
-rw-r--r--bot.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/bot.pl b/bot.pl
index 7f625f0..4bb7379 100644
--- a/bot.pl
+++ b/bot.pl
@@ -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
391sub 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
390sub francoise_donothing { 405sub francoise_donothing {
391} 406}
392 407