summaryrefslogtreecommitdiff
path: root/bot.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bot.pl')
-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