mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
Add config variable supybot.abuse.flood.command.notify.
This commit is contained in:
parent
2e7df9cfc2
commit
685bedcd74
@ -252,11 +252,12 @@ class Owner(callbacks.Plugin):
|
|||||||
self.log.info('Ignoring %s for %s seconds due to an apparent '
|
self.log.info('Ignoring %s for %s seconds due to an apparent '
|
||||||
'command flood.', banmask, punishment)
|
'command flood.', banmask, punishment)
|
||||||
ircdb.ignores.add(banmask, time.time() + punishment)
|
ircdb.ignores.add(banmask, time.time() + punishment)
|
||||||
irc.reply('You\'ve given me %s commands within the last '
|
if conf.supybot.abuse.flood.command.notify():
|
||||||
'%i seconds; I\'m now ignoring you for %s.' %
|
irc.reply('You\'ve given me %s commands within the last '
|
||||||
(maximum,
|
'%i seconds; I\'m now ignoring you for %s.' %
|
||||||
conf.supybot.abuse.flood.interval(),
|
(maximum,
|
||||||
utils.timeElapsed(punishment, seconds=False)))
|
conf.supybot.abuse.flood.interval(),
|
||||||
|
utils.timeElapsed(punishment, seconds=False)))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
tokens = callbacks.tokenize(s, channel=msg.args[0])
|
tokens = callbacks.tokenize(s, channel=msg.args[0])
|
||||||
|
@ -732,6 +732,9 @@ registerGlobalValue(supybot.abuse.flood.command, 'maximum',
|
|||||||
registerGlobalValue(supybot.abuse.flood.command, 'punishment',
|
registerGlobalValue(supybot.abuse.flood.command, 'punishment',
|
||||||
registry.PositiveInteger(300, _("""Determines how many seconds the bot
|
registry.PositiveInteger(300, _("""Determines how many seconds the bot
|
||||||
will ignore users who flood it with commands.""")))
|
will ignore users who flood it with commands.""")))
|
||||||
|
registerGlobalValue(supybot.abuse.flood.command, 'notify',
|
||||||
|
registry.Boolean(True, _("""Determines whether the bot will notify people
|
||||||
|
that they're being ignored for command flooding.""")))
|
||||||
|
|
||||||
registerGlobalValue(supybot.abuse.flood.command, 'invalid',
|
registerGlobalValue(supybot.abuse.flood.command, 'invalid',
|
||||||
registry.Boolean(True, _("""Determines whether the bot will defend itself
|
registry.Boolean(True, _("""Determines whether the bot will defend itself
|
||||||
|
Loading…
Reference in New Issue
Block a user