Interpreter: allow optional bot trigger prefix in /msg

This commit is contained in:
Pragmatic Software 2021-06-29 08:21:46 -07:00
parent 41bcfc2e01
commit b7fff15896
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}