mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 16:05:40 -04:00
fixing bug with addressed behavior
This commit is contained in:
parent
f6091166bd
commit
17d48f5419
1 changed files with 2 additions and 1 deletions
|
@ -360,7 +360,8 @@ sub _parse_for_commands {
|
|||
my $command_re = join '|', map "\Q$_", keys %$commands;
|
||||
$command_re = qr/$command_re/; #TODO move to _pre_build_chains and switch to Trie
|
||||
|
||||
if( $said->{body} =~ s/^\s*($command_re)[:,;]\s*(.+)/$2/
|
||||
if( (!$said->{addressed} && $said->{body} =~ s/^\s*($command_re)[:,;]\s*(.+)/$2/)
|
||||
or ($said->{addressed} && $said->{body} =~ s/^\s*($command_re)[ :,;-]\s*(.+)/$2/)
|
||||
or $said->{body} =~ s/^\s*($command_re)\s*$// ) {
|
||||
|
||||
my $found_command = $1;
|
||||
|
|
Loading…
Add table
Reference in a new issue