- enhance "lost" command
authorAndreas Scherbaum <andreas@scherbaum.biz>
Wed, 13 Jun 2012 21:34:15 +0000 (23:34 +0200)
committerAndreas Scherbaum <andreas@scherbaum.biz>
Wed, 13 Jun 2012 21:34:15 +0000 (23:34 +0200)
docbot.conf
docbot.pl

index ed2adb34a698dbf5209ed8a81e8604739f65b093..4472a0740d2ca2fbdc12979013faababfe880d35 100644 (file)
@@ -96,6 +96,7 @@ translations:
     help_general_line_3: 'Die folgenden Befehle stehen außerdem zur VerfΓΌgung'
     help_general_line_say: 'Nutze: ?sage #channel Nachricht'
     help_general_line_lost: 'Nutze: ?lost'
+    lost_only_in_commandchannel: 'Der "lost" Befehl ist nur im Adminchannel erlaubt'
     search_bad_parameters: 'Falsche Parameter'
     search_no_new_keywords: 'Alle SchlΓΌsselwΓΆrter existieren bereits in der Datenbank'
     search_add_1_keyword: '1 SchlΓΌsselwort erfolgreich hinzugefΓΌgt'
index d20c5adac0cff773f17aa1e88762e4046d105b22..e47d8e04e5ee015fa2c357711f9c5ce469d2e7b7 100755 (executable)
--- a/docbot.pl
+++ b/docbot.pl
@@ -1963,6 +1963,7 @@ sub handle_command_status {
     push(@commands, 'join: ' . $main::statistics{'command_counter_join'});
     push(@commands, 'leave: ' . $main::statistics{'command_counter_leave'});
     push(@commands, 'status: ' . $main::statistics{'command_counter_status'});
+    push(@commands, 'lost: ' . $main::statistics{'command_counter_lost'});
     $irc->yield( privmsg => $channel, 'Number of executed IRC commands: ' . join(", ", @commands) );
     $irc->yield( privmsg => $channel, 'Number of denied IRC requests: ' . $main::statistics{'command_access_denied'} );
 
@@ -2010,10 +2011,16 @@ sub handle_command_lost {
 
     # 'lost' goes to the command channel only
     if (lc($channel) eq lc($irc->nick_name())) {
-        return 'The "lost" command is only allowed in the command channel';
+        my $answer = 'The "lost" command is only allowed in the command channel';
+        # translate error message
+        $answer = translate_text_for_channel($channel, 'lost_only_in_commandchannel', $answer);
+        return $answer;
     }
     if (lc($channel) ne lc(config_get_key2('bot', 'commandchannel'))) {
-        return 'The "lost" command is only allowed in the command channel';
+        my $answer = 'The "lost" command is only allowed in the command channel';
+        # translate error message
+        $answer = translate_text_for_channel($channel, 'lost_only_in_commandchannel', $answer);
+        return $answer;
     }