From 494fc429b101e371b21b3f6e018cc7478a0e8876 Mon Sep 17 00:00:00 2001 From: kiffer <> Date: Thu, 4 Aug 2005 12:09:37 +0000 Subject: !forget implementiert --- bot.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bot.pl b/bot.pl index f0f6459..fb5b336 100644 --- a/bot.pl +++ b/bot.pl @@ -365,6 +365,18 @@ sub francoise_alias{ } sub francoise_forget { + my ($kernel, $channel, $what) = @_; + + my ($tmp) = $dbh->selectrow_array("SELECT COUNT(*) FROM knowledge WHERE trigger = ?", undef, $what); + + if ($tmp) + { + $dbh->do("DELETE FROM knowledge WHERE trigger = ?", undef, $what); + $kernel->post('francoise', 'privmsg', $channel, "Mist, seit der letzten Tuete weiss ich nix mehr von $what :("); + } else + { + $kernel->post('francoise', 'privmsg', $channel, "$what? Nie von gehoert! *schwoer*"); + } } sub francoise_donothing { -- cgit v1.2.3