diff options
| author | kiffer <> | 2005-08-05 11:44:28 +0000 |
|---|---|---|
| committer | kiffer <> | 2005-08-05 11:44:28 +0000 |
| commit | a2072392c6b8e2d5f2a61ed5ef23a7ba6d516904 (patch) | |
| tree | 092ef3ab4898db68970d826ce351e5bcfbb76239 | |
| parent | 3f710d4a969eeeb9c6fcb8a231fdfd507028f67a (diff) | |
added "!count"
| -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 | ||
