From e191f0652ff5511512b9cf102a143daca21afeed Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 26 Jul 2019 15:55:03 -0700 Subject: [PATCH] Update Plugins timed ban/mute invocations --- PBot/Plugins/AntiKickAutoRejoin.pm | 2 +- PBot/Plugins/AntiNickSpam.pm | 2 +- PBot/Plugins/AntiRepeat.pm | 6 +++--- PBot/Plugins/AntiTwitter.pm | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/Plugins/AntiKickAutoRejoin.pm b/PBot/Plugins/AntiKickAutoRejoin.pm index 9d0f2613..580f5335 100644 --- a/PBot/Plugins/AntiKickAutoRejoin.pm +++ b/PBot/Plugins/AntiKickAutoRejoin.pm @@ -74,7 +74,7 @@ sub on_join { my $duration = duration($timeout); $duration =~ s/s$//; # hours -> hour, minutes -> minute - $self->{pbot}->{chanops}->ban_user_timed("*!$user\@$host", $channel, $timeout); + $self->{pbot}->{chanops}->ban_user_timed($self->{pbot}->{registry}->get_value('irc', 'botnick'), 'autorejoining after kick', "*!$user\@$host", $channel, $timeout); $self->{pbot}->{chanops}->add_op_command($channel, "kick $channel $nick $duration ban for auto-rejoining after kick"); $self->{pbot}->{chanops}->gain_ops($channel); $self->{kicks}->{$channel}->{$nick}->{rejoins}++; diff --git a/PBot/Plugins/AntiNickSpam.pm b/PBot/Plugins/AntiNickSpam.pm index 65e24003..b3339a4c 100644 --- a/PBot/Plugins/AntiNickSpam.pm +++ b/PBot/Plugins/AntiNickSpam.pm @@ -80,7 +80,7 @@ sub check_flood { if (exists $self->{nicks}->{$channel} and @{$self->{nicks}->{$channel}} >= 10) { $self->{pbot}->{logger}->log("Nick spam flood detected in $channel\n"); - $self->{pbot}->{chanops}->mute_user_timed('$~a', $channel, 60 * 15); + $self->{pbot}->{chanops}->mute_user_timed($self->{pbot}->{registry}->get_value('irc', 'botnick'), 'nick spam flooding', '$~a', $channel, 60 * 15); } } diff --git a/PBot/Plugins/AntiRepeat.pm b/PBot/Plugins/AntiRepeat.pm index d8b01108..67a6686e 100644 --- a/PBot/Plugins/AntiRepeat.pm +++ b/PBot/Plugins/AntiRepeat.pm @@ -146,13 +146,13 @@ sub on_public { $self->{pbot}->{chanops}->gain_ops($channel); } when (2) { - $self->{pbot}->{chanops}->ban_user_timed("*!*\@$host", $channel, 60); + $self->{pbot}->{chanops}->ban_user_timed($botnick, 'repeating messages', "*!*\@$host", $channel, 60); } when (3) { - $self->{pbot}->{chanops}->ban_user_timed("*!*\@$host", $channel, 60 * 15); + $self->{pbot}->{chanops}->ban_user_timed($botnick, 'repeating messages', "*!*\@$host", $channel, 60 * 15); } default { - $self->{pbot}->{chanops}->ban_user_timed("*!*\@$host", $channel, 60 * 60); + $self->{pbot}->{chanops}->ban_user_timed($botnick, 'repeating messages', "*!*\@$host", $channel, 60 * 60); } } return 0; diff --git a/PBot/Plugins/AntiTwitter.pm b/PBot/Plugins/AntiTwitter.pm index dcbd1f10..6d1d9d88 100644 --- a/PBot/Plugins/AntiTwitter.pm +++ b/PBot/Plugins/AntiTwitter.pm @@ -64,7 +64,7 @@ sub on_public { default { my $offenses = $self->{offenses}->{$channel}->{$nick}->{offenses} - 2; my $length = 60 * ($offenses * $offenses + 1); - $self->{pbot}->{chanops}->ban_user_timed("*!*\@$host", $channel, $length); + $self->{pbot}->{chanops}->ban_user_timed($self->{pbot}->{registry}->get_value('irc', 'botnick'), 'using @nick too much', "*!*\@$host", $channel, $length); $self->{pbot}->{chanops}->gain_ops($channel); $length = duration $length; $event->{conn}->privmsg($nick, "$nick: Please do not use \@nick to address people. Drop the @ symbol; it's not necessary and it's ugly. You were warned. You will be allowed to speak again in $length.");