3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 11:12:42 +01:00

AntiAway/AntiHello: added "2nd offense" text to warning kick message

This commit is contained in:
Pragmatic Software 2024-08-10 14:02:58 -07:00
parent de42067e28
commit b31aa7a816
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
3 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ sub punish($self, $msg, $channel, $nick, $user, $host) {
$self->{pbot}->{logger}->log("[anti-away] $nick!$user\@$host offense $self->{kick_counter}->{$channel}->{$nick}\n"); $self->{pbot}->{logger}->log("[anti-away] $nick!$user\@$host offense $self->{kick_counter}->{$channel}->{$nick}\n");
if ($self->{kick_counter}->{$channel}->{$nick} == 2) { if ($self->{kick_counter}->{$channel}->{$nick} == 2) {
$msg .= ' (WARNING: next offense will result in a temp-ban)'; $msg .= ' (2ND OFFENSE WARNING: next offense will result in a temp-ban)';
} elsif ($self->{kick_counter}->{$channel}->{$nick} > 2) { } elsif ($self->{kick_counter}->{$channel}->{$nick} > 2) {
$msg .= ' (temp ban for repeated offenses)'; $msg .= ' (temp ban for repeated offenses)';
} }

View File

@ -14,7 +14,7 @@ use PBot::Imports;
sub initialize($self, %conf) { sub initialize($self, %conf) {
$self->{pbot}->{registry}->add_default('text', 'antihello', 'bad_greetings', $self->{pbot}->{registry}->add_default('text', 'antihello', 'bad_greetings',
$conf{bad_greetings} // '^\s*(?:[[:punct:]]|\p{Emoticons})*\s*(?:h*e+l+l+o+|h+e+y+a+|y+o+|h*e+n+l+o+|l+o+|h+i+|g+o+d+\s*(d+a+y+|m+o+r+n+i+n+g*|e+v+e+n+i+n+g*|a+f+t+e+r+n+o+n+|n+o+n+)|w*a*s+u+p+|g+[[:punct:]]*d+a+y+|g+r+e+t+s*z*|g+r+e+t+i+n+g+s*|h*o+l+a+|o+i+|h*e+y+|h+a+y+|o*h+a+i+)\s*(?:\s+.{1,10})?\s*(?:[[:punct:]]|\p{Emoticons})*\s*$' $conf{bad_greetings} // '^\s*(?:[[:punct:]]|\p{Emoticons})*\s*(?:h*e+l+l+o+|h+e+y+a+|y+o+|h*e+n+l+o+|l+o+|h+i+|g+o*d*\s*[[:punct:]]*\s*(d+a+y+|m+o+r+n+i*n*g*|e+v+e+n+i+n+g*|a+f+t+e+r+n+o+n+|n+o+n+)|w*a*s+u+p+|g+[[:punct:]]*d+a+y+|g+r+e+t+s*z*|g+r+e+t+i+n+g+s*|h*o+l+a+|o+i+|h*e+y+|h+a+y+|o*h+a+i+)\s*[[:punct:]]*\s*(?:\s+.{1,15})?\s*(?:[[:punct:]]|\p{Emoticons})*\s*$'
); );
$self->{pbot}->{registry}->add_default('text', 'antihello', 'kick_msg', 'https://nohello.net/'); $self->{pbot}->{registry}->add_default('text', 'antihello', 'kick_msg', 'https://nohello.net/');
@ -46,7 +46,7 @@ sub punish($self, $msg, $channel, $nick, $user, $host) {
} }
return 0; return 0;
} elsif ($self->{offense_counter}->{$channel}->{$nick} == 2) { } elsif ($self->{offense_counter}->{$channel}->{$nick} == 2) {
$msg .= ' (WARNING: next offense will result in a temp-ban)'; $msg .= ' (2ND OFFENSE WARNING: next offense will result in a temp-ban)';
} elsif ($self->{offense_counter}->{$channel}->{$nick} > 2) { } elsif ($self->{offense_counter}->{$channel}->{$nick} > 2) {
$msg .= ' (temp ban for repeated offenses)'; $msg .= ' (temp ban for repeated offenses)';
} }

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4777, BUILD_REVISION => 4778,
BUILD_DATE => "2024-08-07", BUILD_DATE => "2024-08-10",
}; };
sub initialize {} sub initialize {}