From b7fff1589633088237c7e7276f626ed0e1a9f941 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 29 Jun 2021 08:21:46 -0700 Subject: [PATCH] Interpreter: allow optional bot trigger prefix in /msg --- PBot/Interpreter.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index 6ecfb4bd..6e8798c0 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -50,7 +50,7 @@ sub process_line { # processing of this message. this object is passed between various bot # functions and interfaces, which may themselves add more fields. my $context = { - from => $from, # source (channel, sender hostmask, "pbot@stdin", etc) + from => $from, # source (channel, sender hostmask, 'stdin@pbot', etc) nick => $nick, # nickname user => $user, # username host => $host, # hostname/ip address @@ -111,6 +111,7 @@ sub process_line { # (i.e., it came from /msg or was otherwise flagged as a command) if ($is_command) { $command = $cmd_text; + $command =~ s/^$bot_trigger//; # strip leading bot trigger, if any goto CHECK_EMBEDDED_CMD; }