From 56cf40827f8c54926936ecfbb256651493c70750 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 16 May 2018 14:02:49 +1200 Subject: Add command to inspect ignores --- idalius.pl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'idalius.pl') diff --git a/idalius.pl b/idalius.pl index c88ed8e..fd44242 100755 --- a/idalius.pl +++ b/idalius.pl @@ -294,6 +294,10 @@ sub irc_msg { $irc->yield(privmsg => $nick => "Syntax: topic "); } } + if ($what =~ /^who are you ignoring/) { + my $ignores = join ", ", @{$config{ignore}}; + $irc->yield(privmsg => $nick => "I am ignoring: $ignores"); + } if ($what =~ /^mode\s/) { my ($rest) = $what =~ /^mode\s+(.*)?$/; if ($rest) { -- cgit v1.1 From 7ef75e83372ff08223ff1ad31891cb0586abdff3 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 17 May 2018 21:32:55 +1200 Subject: Lower spam limit, tell person we ignore --- idalius.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'idalius.pl') 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; } -- cgit v1.1 From b1f4150fc408b00e20117be28ff111a3d3c27fa8 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 18 May 2018 14:11:54 +1200 Subject: Correct order of ignore message --- idalius.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'idalius.pl') diff --git a/idalius.pl b/idalius.pl index 4c9c8f3..89c89e5 100755 --- a/idalius.pl +++ b/idalius.pl @@ -190,8 +190,8 @@ sub irc_public { if ($module->can("message")) { $output = $module->message(\&log_info, $irc->nick_name, $who, $where, $what, $stripped_what, $irc); } - strike_add($nick, $channel) if $output; $irc->yield(privmsg => $where => $output) if $output; + strike_add($nick, $channel) if $output; } return; -- cgit v1.1