AttackProtector: Add supybot.plugins.AttackProtector.*.kickmessage.

master
Valentin Lorentz 2013-05-18 15:34:47 +02:00
parent 2d827d3bc9
commit 1ef8c6ba2a
2 changed files with 7 additions and 1 deletions

View File

@ -111,5 +111,9 @@ for kind, data in kinds.items():
conf.registerChannelValue(getattr(AttackProtector, kind), 'punishment',
Punishment(punishment, _("""Determines the punishment applied when
%s.""") % help_))
conf.registerChannelValue(getattr(AttackProtector, kind), 'kickmessage',
registry.String('', _("""The kick message used
when a user abuses the channel with this kind of flood. If empty,
defaults to supybot.plugins.AttackProtector.kickmessage.""")))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:

View File

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