From b9d6277e3056ce47098e260b06875181bd4dc081 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 9 Jun 2009 10:40:05 -0500 Subject: [PATCH] Added supybot.abuse.flood.command.invalid.notify, a configuration variable determining whether the bot will notify infractors of their ignoring. --- plugins/Misc/plugin.py | 9 +++++---- src/conf.py | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 5680589fb..c67068069 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -75,10 +75,11 @@ class Misc(callbacks.Plugin): 'observed. Consider ignoring this bot ' 'permanently.') ircdb.ignores.add(banmask, time.time() + punishment) - irc.reply('You\'ve given me %s invalid commands within the last ' - 'minute; I\'m now ignoring you for %s.' % - (maximum, - utils.timeElapsed(punishment, seconds=False))) + if conf.supybot.abuse.flood.command.invalid.notify(): + irc.reply('You\'ve given me %s invalid commands within the last ' + 'minute; I\'m now ignoring you for %s.' % + (maximum, + utils.timeElapsed(punishment, seconds=False))) return # Now, for normal handling. channel = msg.args[0] diff --git a/src/conf.py b/src/conf.py index 2340cb2d8..a82b91fd9 100644 --- a/src/conf.py +++ b/src/conf.py @@ -651,6 +651,9 @@ registerGlobalValue(supybot.abuse.flood.command.invalid, 'punishment', value is higher than supybot.abuse.flood.command.punishment, since it's far less likely (and far more annoying) for users to flood witih invalid commands than for them to flood with valid commands.""")) +registerGlobalValue(supybot.abuse.flood.command.invalid, 'notify', + registry.Boolean(True, """Determines whether the bot will notify people that they're + being ignored for invalid command flooding.""")) ###