mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-18 14:30:40 +01:00
AntiTwitter: Warn twice before tempban; add logging
This commit is contained in:
parent
30eba50bdc
commit
9621c6ffbe
@ -46,12 +46,17 @@ sub on_public {
|
|||||||
$self->{offenses}->{$channel}->{$nick}->{offenses}++;
|
$self->{offenses}->{$channel}->{$nick}->{offenses}++;
|
||||||
$self->{offenses}->{$channel}->{$nick}->{time} = gettimeofday;
|
$self->{offenses}->{$channel}->{$nick}->{time} = gettimeofday;
|
||||||
|
|
||||||
|
$self->{pbot}->{logger}->log("$nick!$user\@$host is a twit. $self->{offenses}->{$channel}->{$nick}->{offenses} offenses. Msg: $msg\n");
|
||||||
|
|
||||||
given ($self->{offenses}->{$channel}->{$nick}->{offenses}) {
|
given ($self->{offenses}->{$channel}->{$nick}->{offenses}) {
|
||||||
when (1) {
|
when (1) {
|
||||||
|
$event->{conn}->privmsg($nick, "$nick: Please do not use \@nick to address people. Drop the @ symbol; it's not necessary and it's ugly.");
|
||||||
|
}
|
||||||
|
when (2) {
|
||||||
$event->{conn}->privmsg($nick, "$nick: Please do not use \@nick to address people. Drop the @ symbol; it's not necessary and it's ugly. Doing this again will result in a temporary ban.");
|
$event->{conn}->privmsg($nick, "$nick: Please do not use \@nick to address people. Drop the @ symbol; it's not necessary and it's ugly. Doing this again will result in a temporary ban.");
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
my $offenses = $self->{offenses}->{$channel}->{$nick}->{offenses} - 1;
|
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("*!*\@$host", $channel, $length);
|
||||||
$self->{pbot}->{chanops}->gain_ops($channel);
|
$self->{pbot}->{chanops}->gain_ops($channel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user