1
0
Fork 0
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:
Ryan Voots 2011-02-08 20:31:45 -05:00
parent f6091166bd
commit 17d48f5419

View file

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