3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-01-26 20:14:34 +01:00

Make AntiTwitter more robust

This commit is contained in:
Pragmatic Software 2017-02-22 12:09:06 -08:00
parent 0685843e3f
commit 75ca6d61a8

View File

@ -40,9 +40,9 @@ sub on_public {
$channel = lc $channel; $channel = lc $channel;
return 0 if not $self->{pbot}->{chanops}->can_gain_ops($channel); return 0 if not $self->{pbot}->{chanops}->can_gain_ops($channel);
while ($msg =~ m/@([^,;: ]+)/g) { while ($msg =~ m/@([a-z0-9_^{}\-\\\[\]\|]+)/g) {
my $n = $1; my $n = $1;
if ($self->{pbot}->{nicklist}->is_present($channel, $n)) { if ($self->{pbot}->{nicklist}->is_present_similar($channel, $n)) {
$self->{offenses}->{$channel}->{$nick}->{offenses}++; $self->{offenses}->{$channel}->{$nick}->{offenses}++;
$self->{offenses}->{$channel}->{$nick}->{time} = gettimeofday; $self->{offenses}->{$channel}->{$nick}->{time} = gettimeofday;