diff --git a/lib/PBot/Plugin/AntiAway.pm b/lib/PBot/Plugin/AntiAway.pm index 5067f724..1009aa47 100644 --- a/lib/PBot/Plugin/AntiAway.pm +++ b/lib/PBot/Plugin/AntiAway.pm @@ -33,14 +33,16 @@ sub unload($self) { sub punish($self, $msg, $channel, $nick, $user, $host) { $self->{kick_counter}->{$channel}->{$nick}++; - if ($self->{kick_counter}->{$channel}->{$nick} >= 2) { + if ($self->{kick_counter}->{$channel}->{$nick} == 2) { $msg .= ' (WARNING: next offense will result in a temp ban)'; + } elsif ($self->{kick_counter}->{$channel}->{$nick} > 2) { + $msg .= ' (temp ban for repeated offenses)'; } $self->{pbot}->{chanops}->add_op_command($channel, "kick $channel $nick $msg"); $self->{pbot}->{chanops}->gain_ops($channel); - if ($self->{kick_counter}->{$channel}->{$nick} >= 3) { + if ($self->{kick_counter}->{$channel}->{$nick} > 2) { my $botnick = $self->{pbot}->{conn}->nick; $self->{pbot}->{banlist}->ban_user_timed($channel, 'b', "*!*\@$host", 60 * 60 * 2, $botnick, 'anti-away'); } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 1e3f2c5a..4418f6bb 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4771, + BUILD_REVISION => 4772, BUILD_DATE => "2024-07-22", };