3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Improve !cmd and nick: !cmd processing

This commit is contained in:
Pragmatic Software 2016-10-23 03:51:59 -07:00
parent 0397068a7f
commit 170dac5776

View File

@ -117,20 +117,21 @@ sub process_line {
my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override); my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override);
$nick_override = $similar if $similar; $nick_override = $similar if $similar;
$processed += 100; $processed += 100;
} elsif($cmd_text =~ s/^\s*([^,:\(\)\+\*\/ ]+)?[,:]*\s*$bot_trigger(.*)$//) { } elsif($cmd_text =~ s/^\s*([^,:\(\)\+\*\/ ]+)[,:]?\s+$bot_trigger(.*)$//) {
$nick_override = $1; $nick_override = $1;
$command = $2; $command = $2;
if (defined $nick_override) { my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override);
my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override); if ($similar) {
if ($similar) { $nick_override = $similar;
$nick_override = $similar; } else {
} else { $self->{pbot}->{logger}->log("No similar nick for $nick_override\n");
$self->{pbot}->{logger}->log("No similar nick for $nick_override\n"); return 0;
return 0;
}
} }
$processed += 100;
} elsif($cmd_text =~ s/^$bot_trigger(.*)$//) {
$command = $1;
$processed += 100; $processed += 100;
} elsif($cmd_text =~ s/^.?$botnick.?\s*(.*?)$//i) { } elsif($cmd_text =~ s/^.?$botnick.?\s*(.*?)$//i) {
$command = $1; $command = $1;