mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-17 05:50:56 +01:00
Update Plugins timed ban/mute invocations
This commit is contained in:
parent
167edf8d95
commit
e191f0652f
@ -74,7 +74,7 @@ sub on_join {
|
|||||||
my $duration = duration($timeout);
|
my $duration = duration($timeout);
|
||||||
$duration =~ s/s$//; # hours -> hour, minutes -> minute
|
$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}->add_op_command($channel, "kick $channel $nick $duration ban for auto-rejoining after kick");
|
||||||
$self->{pbot}->{chanops}->gain_ops($channel);
|
$self->{pbot}->{chanops}->gain_ops($channel);
|
||||||
$self->{kicks}->{$channel}->{$nick}->{rejoins}++;
|
$self->{kicks}->{$channel}->{$nick}->{rejoins}++;
|
||||||
|
@ -80,7 +80,7 @@ sub check_flood {
|
|||||||
|
|
||||||
if (exists $self->{nicks}->{$channel} and @{$self->{nicks}->{$channel}} >= 10) {
|
if (exists $self->{nicks}->{$channel} and @{$self->{nicks}->{$channel}} >= 10) {
|
||||||
$self->{pbot}->{logger}->log("Nick spam flood detected in $channel\n");
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,13 +146,13 @@ sub on_public {
|
|||||||
$self->{pbot}->{chanops}->gain_ops($channel);
|
$self->{pbot}->{chanops}->gain_ops($channel);
|
||||||
}
|
}
|
||||||
when (2) {
|
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) {
|
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 {
|
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;
|
return 0;
|
||||||
|
@ -64,7 +64,7 @@ sub on_public {
|
|||||||
default {
|
default {
|
||||||
my $offenses = $self->{offenses}->{$channel}->{$nick}->{offenses} - 2;
|
my $offenses = $self->{offenses}->{$channel}->{$nick}->{offenses} - 2;
|
||||||
my $length = 60 * ($offenses * $offenses + 1);
|
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);
|
$self->{pbot}->{chanops}->gain_ops($channel);
|
||||||
$length = duration $length;
|
$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.");
|
$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.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user