diff --git a/PBot/Plugins/AntiRepeat.pm b/PBot/Plugins/AntiRepeat.pm index 325cc88c..6404f767 100644 --- a/PBot/Plugins/AntiRepeat.pm +++ b/PBot/Plugins/AntiRepeat.pm @@ -96,7 +96,8 @@ sub on_public { foreach my $string1 (@$messages) { next if $now - $string1->{timestamp} > 60 * 60 * 2; next if $allow_bot and $string1->{msg} =~ m/^(?:$bot_trigger|$botnick.?)/; - next if length $string1->{msg} <= 5; # allow really short messages since "yep" "ok" etc are so common + $string1->{msg} =~ s/^[^;,:]{1,20}//; # remove nick-like prefix if one exists + next if length $string1->{msg} <= 5; # allow really short messages since "yep" "ok" etc are so common if (exists $self->{offenses}->{$account} and exists $self->{offenses}->{$account}->{$channel}) { next if $self->{offenses}->{$account}->{$channel}->{last_offense} >= $string1->{timestamp}; @@ -105,7 +106,8 @@ sub on_public { foreach my $string2 (@$messages) { next if $now - $string2->{timestamp} > 60 * 60 * 2; next if $allow_bot and $string2->{msg} =~ m/^(?:$bot_trigger|$botnick.?)/; - next if length $string2->{msg} <= 5; # allow really short messages since "yep" "ok" etc are so common + $string2->{msg} =~ s/^[^;,:]{1,20}//; # remove nick-like prefix if one exists + next if length $string2->{msg} <= 5; # allow really short messages since "yep" "ok" etc are so common if (exists $self->{offenses}->{$account} and exists $self->{offenses}->{$account}->{$channel}) { next if $self->{offenses}->{$account}->{$channel}->{last_offense} >= $string2->{timestamp};