mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
Improve !cmd
and nick: !cmd
processing
This commit is contained in:
parent
0397068a7f
commit
170dac5776
@ -117,11 +117,10 @@ sub process_line {
|
||||
my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override);
|
||||
$nick_override = $similar if $similar;
|
||||
$processed += 100;
|
||||
} elsif($cmd_text =~ s/^\s*([^,:\(\)\+\*\/ ]+)?[,:]*\s*$bot_trigger(.*)$//) {
|
||||
} elsif($cmd_text =~ s/^\s*([^,:\(\)\+\*\/ ]+)[,:]?\s+$bot_trigger(.*)$//) {
|
||||
$nick_override = $1;
|
||||
$command = $2;
|
||||
|
||||
if (defined $nick_override) {
|
||||
my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override);
|
||||
if ($similar) {
|
||||
$nick_override = $similar;
|
||||
@ -129,8 +128,10 @@ sub process_line {
|
||||
$self->{pbot}->{logger}->log("No similar nick for $nick_override\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$processed += 100;
|
||||
} elsif($cmd_text =~ s/^$bot_trigger(.*)$//) {
|
||||
$command = $1;
|
||||
$processed += 100;
|
||||
} elsif($cmd_text =~ s/^.?$botnick.?\s*(.*?)$//i) {
|
||||
$command = $1;
|
||||
|
Loading…
Reference in New Issue
Block a user