From: Andreas Scherbaum Date: Sun, 19 Aug 2012 23:11:30 +0000 (+0200) Subject: - log learn and forget to the command channel X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=75fca322f940117f3e199ae7797b74bf5fc296dd;p=docbot.git - log learn and forget to the command channel --- diff --git a/docbot.pl b/docbot.pl index 82de02f..2072ba8 100755 --- a/docbot.pl +++ b/docbot.pl @@ -3125,6 +3125,11 @@ sub handle_command_learn { my %keywords = map { $_, 1 } @keywords; @keywords = keys(%keywords); + if (is_a_channel($channel)) { + send_to_commandchannel("learn, by $nick in $channel: $string"); + } else { + send_to_commandchannel("learn, by $nick: $string"); + } $main::db->rollback(); @@ -3293,6 +3298,12 @@ sub handle_command_forget { my @keys = split(/\s+/, $string); my $url_pattern = config_get_key2('search', 'urlpattern'); + if (is_a_channel($channel)) { + send_to_commandchannel("forget, by $nick in $channel: $string"); + } else { + send_to_commandchannel("forget, by $nick: $string"); + } + $main::db->rollback(); diff --git a/todo.txt b/todo.txt index d45ecd7..fb2d36a 100644 --- a/todo.txt +++ b/todo.txt @@ -7,7 +7,6 @@ - track each channel message and see, if the bot was mentioned - Log::Log4perl? - provide hook for depesz to catch all URLs and scan them for explain's -- post important commands into commandchannel - even in info log modus, post more infos to the log about the current commans @@ -33,3 +32,4 @@ - allow a password for the ?join command OK - verify channel list from time to time, autojoin missing channels OK - nickserv handling (passwords) OK +- post important commands into commandchannel OK