Added supybot.abuse.flood.command.invalid.notify, a configuration variable determining whether the bot will notify infractors of their ignoring.

This commit is contained in:
Jeremy Fincher 2009-06-09 10:40:05 -05:00
parent 416a6e8dd2
commit b9d6277e30
2 changed files with 8 additions and 4 deletions

View File

@ -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]

View File

@ -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."""))
###