From e723379c4db449eddd712f45f93991987391ea20 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 1 Aug 2017 21:34:57 -0700 Subject: [PATCH] Improve the bot's understanding of "me" and "my" --- PBot/Interpreter.pm | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index 500e7248..30e04b9e 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -202,18 +202,14 @@ sub interpret { $keyword = $command; } - if($keyword ne "factadd" - and $keyword ne "add" - and $keyword ne "factfind" - and $keyword ne "find" - and $keyword ne "factshow" - and $keyword ne "show" - and $keyword ne "factset" - and $keyword ne "factchange" - and $keyword ne "change" - and $keyword ne "msg") { + $tonick = $nick if $tonick eq 'me'; + + if ($keyword !~ /^(factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell)/) { $keyword =~ s/(\w+)([?!.]+)$/$1/; - $arguments =~ s/(?{pbot}->{registry}->get_value('irc', 'botnick');