aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-05-17 21:32:55 +1200
committerDavid Phillips <david@sighup.nz>2018-05-17 21:32:55 +1200
commit7ef75e83372ff08223ff1ad31891cb0586abdff3 (patch)
treee40a1f0a23e675314dcb7b16333098589ff2b02b
parent56cf40827f8c54926936ecfbb256651493c70750 (diff)
downloadidalius-7ef75e83372ff08223ff1ad31891cb0586abdff3.tar.xz
Lower spam limit, tell person we ignore
-rwxr-xr-xidalius.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/idalius.pl b/idalius.pl
index fd44242..4c9c8f3 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -109,10 +109,10 @@ sub drop_priv {
# This differs from antiflood.pm in that it is used only for when users have
# triggered a response from the bot.
sub strike_add {
- my $strike_count = 15;
- my $strike_period = 30;
+ my $strike_count = 14;
+ my $strike_period = 45;
- my ($nick) = @_;
+ my ($nick, $channel) = @_;
my $now = time();
push @{$laststrike{$nick}}, $now;
if (@{$laststrike{$nick}} >= $strike_count) {
@@ -120,6 +120,7 @@ sub strike_add {
my $first = @{$laststrike{$nick}}[0];
if ($now - $first <= $strike_period) {
log_info "Ignoring $nick because of command flood";
+ $irc->yield(privmsg => $channel => "$nick: I'm ignoring you now, you've caused me to talk too much");
push @{$config{ignore}}, $nick;
}
}
@@ -181,7 +182,7 @@ sub irc_public {
if ($stripped_what =~ s/^$config{prefix}//) {
$output = run_command($stripped_what, $who, $where);
$irc->yield(privmsg => $where => $output) if $output;
- strike_add $nick if $output;
+ strike_add($nick, $channel) if $output;
}
for my $module (@plugin_list) {
@@ -189,7 +190,7 @@ sub irc_public {
if ($module->can("message")) {
$output = $module->message(\&log_info, $irc->nick_name, $who, $where, $what, $stripped_what, $irc);
}
- strike_add $nick if $output;
+ strike_add($nick, $channel) if $output;
$irc->yield(privmsg => $where => $output) if $output;
}