mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Interpreter: allow optional bot trigger prefix in /msg
This commit is contained in:
parent
41bcfc2e01
commit
b7fff15896
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user