3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 11:42:35 +01:00

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

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");