mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 03:33:06 +01:00
Improve !cmd
and nick: !cmd
processing
This commit is contained in:
parent
0397068a7f
commit
170dac5776
@ -117,20 +117,21 @@ 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;
|
||||
} else {
|
||||
$self->{pbot}->{logger}->log("No similar nick for $nick_override\n");
|
||||
return 0;
|
||||
}
|
||||
my $similar = $self->{pbot}->{nicklist}->is_present_similar($from, $nick_override);
|
||||
if ($similar) {
|
||||
$nick_override = $similar;
|
||||
} else {
|
||||
$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