mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-10-14 17:59:29 +02:00
Added a channel-specific enforce value.
This commit is contained in:
parent
180d2e8392
commit
0937ba22ca
@ -68,6 +68,10 @@ class ValidNickOrEmptyString(registry.String):
|
||||
self.value = v
|
||||
|
||||
conf.registerPlugin('Enforcer')
|
||||
conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'enforce',
|
||||
registry.Boolean(True, """Determines whether the bot will enforce
|
||||
capabilities on this channel. Basically, if False, it 'turns off' the
|
||||
plugin for this channel."""))
|
||||
conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'autoOp',
|
||||
registry.Boolean(False, """Determines whether the bot will automatically op
|
||||
people with the <channel>,op capability when they join the channel."""))
|
||||
@ -274,6 +278,9 @@ class Enforcer(callbacks.Privmsg):
|
||||
self._cycle(irc, channel)
|
||||
|
||||
def __call__(self, irc, msg):
|
||||
channel = msg.args[0]
|
||||
if ircutils.isChannel(channel) and \
|
||||
self.registryValue('enforce', channel):
|
||||
chanserv = self.registryValue('ChanServ', irc.network)
|
||||
if chanserv:
|
||||
if ircutils.isUserHostmask(msg.prefix):
|
||||
|
Loading…
Reference in New Issue
Block a user