mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 05:49:27 +01:00
Plugin/TypoSub: final closing slash is now optional
This commit is contained in:
parent
7dda42a181
commit
982cefcebd
@ -57,7 +57,7 @@ sub on_public {
|
||||
if ($msg =~ m/^\s*s([[:punct:]])/) {
|
||||
my $separator = $1;
|
||||
my $sep = quotemeta $separator;
|
||||
if ($msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*?)(?<!\\)${sep}([g]*)\s*$/) {
|
||||
if ($msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*?)(?<!\\)${sep}([g]*)\s*$/ or $msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*?)$/) {
|
||||
my ($regex, $replacement, $modifiers) = ($1, $2, $3);
|
||||
eval {
|
||||
my $rx = qr/$regex/;
|
||||
@ -74,7 +74,7 @@ sub on_public {
|
||||
|
||||
foreach my $message (@$messages) {
|
||||
next if $ignore_commands and $message->{msg} =~ m/^(?:$bot_trigger|$botnick.?)/;
|
||||
next if $message->{msg} =~ m/^\s*s[[:punct:]](.*?)[[:punct:]](.*?)[[:punct:]]g?\s*$/;
|
||||
next if $message->{msg} =~ m/^\s*s[[:punct:]](.*?)[[:punct:]](.*?)[[:punct:]]?g?\s*$/;
|
||||
|
||||
if ($message->{msg} =~ /$rx/) {
|
||||
my $hostmask = $self->{pbot}->{messagehistory}->{database}->find_message_account_by_id($message->{id});
|
||||
|
Loading…
Reference in New Issue
Block a user