3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-27 06:19:25 +01:00

Totally not a bug

Extremely minor rearrangement of interpreter logic so that `!commands` are
parsed before `command, botnick`. Totally not a bug at all. Pay no attention.
This commit is contained in:
Pragmatic Software 2016-06-25 18:09:47 -07:00
parent bc2bbb8fde
commit dcacec18c6

View File

@ -113,15 +113,15 @@ sub process_line {
$has_code = $2 if length $2 and $nick_override !~ /^(?:enum|struct|union)$/;
$preserve_whitespace = 1;
$processed += 100;
} elsif($cmd_text =~ s/^$bot_trigger(.*)$//) {
$command = $1;
$processed += 100;
} elsif($cmd_text =~ s/^.?$botnick.?\s*(.*?)$//i) {
$command = $1;
$processed += 100;
} elsif($cmd_text =~ s/^(.*?),?\s*$botnick[?!.]*$//i) {
$command = $1;
$processed += 100;
} elsif($cmd_text =~ s/^$bot_trigger(.*)$//) {
$command = $1;
$processed += 100;
}
last if not defined $command and not defined $has_code;