AttackProtector: Add supybot.plugins.AttackProtector.kickmessage.

master
Valentin Lorentz 2013-05-15 15:11:27 +00:00
parent cc966b2fe8
commit 2d827d3bc9
2 changed files with 5 additions and 1 deletions

View File

@ -83,6 +83,10 @@ conf.registerChannelValue(AttackProtector, 'enable',
conf.registerGlobalValue(AttackProtector, 'exempt',
registry.String('nopunish', _("""If a user has this capability, he won't be
punished by AttackProtector""")))
conf.registerGlobalValue(AttackProtector, 'kickmessage',
registry.String(_('$kind flood detected'), _("""The kick message used
when a user abuses the channel. $kind will be replaced with the kind
of attack.""")))
conf.registerGlobalValue(AttackProtector, 'delay',
registry.Integer(10, _("""Determines how long (in seconds) the plugin will
wait before being enabled. A too low value makes the bot believe that

View File

@ -188,7 +188,7 @@ class AttackProtector(callbacks.Plugin):
except KeyError:
pass
punishment = self.registryValue('%s.punishment' % kind, channel)
reason = _('%s flood detected') % kind
reason = self.registryValue('kickmessage').replace('$kind', kind)
if punishment == 'kick':
self._eventCatcher(irc, msg, 'kicked', kicked_prefix=prefix)