Exclude "Why would I want to do that to myself?" from specific commands

This commit is contained in:
Pragmatic Software 2017-08-26 04:06:36 -07:00
parent 428268a415
commit 2ac7b6feb6
1 changed files with 13 additions and 13 deletions

View File

@ -204,13 +204,12 @@ sub interpret {
$tonick = $nick if defined $tonick and $tonick eq 'me';
if ($keyword !~ /^(factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)/) {
if ($keyword !~ /^(factrem|forget|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)/) {
$keyword =~ s/(\w+)([?!.]+)$/$1/;
$arguments =~ s/(?<![\w\/\-\\])me\b/$nick/gi if defined $arguments && $depth <= 2;
$arguments =~ s/(?<![\w\/\-\\])my\b/${nick}'s/gi if defined $arguments && $depth <= 2;
$arguments =~ s/\\my\b/my/gi if defined $arguments && $depth <= 2;
$arguments =~ s/\\me\b/me/gi if defined $arguments && $depth <= 2;
}
my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick');
@ -225,6 +224,7 @@ sub interpret {
$self->{pbot}->{logger}->log("Final result ($delay delay) [$message->{message}]\n");
return undef;
}
}
if(not defined $keyword) {
$pbot->{logger}->log("Error 2, no keyword\n");