From a2072392c6b8e2d5f2a61ed5ef23a7ba6d516904 Mon Sep 17 00:00:00 2001 From: kiffer <> Date: Fri, 5 Aug 2005 11:44:28 +0000 Subject: added "!count" --- bot.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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, 'topten0r' => \&francoise_topten0r, 'forget' => \&francoise_forget, 'alias' => \&francoise_alias, + 'count' => \&francoise_count, ); # this helps identify jamaica autorejoiner and doublejoiner @@ -387,6 +388,20 @@ sub francoise_forget { } } +sub francoise_count { + my ($kernel, $channel, $what) = @_; + + my ($tmp) = $dbh->selectrow_array("SELECT COUNT(*) FROM knowledge where trigger = ?", undef, $what); + + if ($tmp) + { + $kernel->post('francoise', 'privmsg', $channel, "Dazu hab ich $tmp schlaue Sachen zu sagen."); + } else + { + $kernel->post('francoise', 'privmsg', $channel, "Zu $what weiss ich noch gar nix."); + } +} + sub francoise_donothing { } -- cgit v1.2.3