- log learn and forget to the command channel
authorAndreas Scherbaum <andreas@scherbaum.biz>
Sun, 19 Aug 2012 23:11:30 +0000 (01:11 +0200)
committerAndreas Scherbaum <andreas@scherbaum.biz>
Sun, 19 Aug 2012 23:11:30 +0000 (01:11 +0200)
docbot.pl
todo.txt

index 82de02f1458497d5407ba941ad37fd841aa93ba9..2072ba8815695a003614193d0c2944e4e9f6fda2 100755 (executable)
--- 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();
 
 
index d45ecd709b4cc7b796e05638bd9976caec58161e..fb2d36a3385d42756188bd46498699268b1a9dbd 100644 (file)
--- 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