mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-10 12:12:33 +01:00
AutoMode: Fix traceback since b5c99b1c
.
This commit is contained in:
parent
fc9daa9953
commit
12b8e44dc7
@ -52,19 +52,22 @@ class AutoMode(callbacks.Plugin):
|
||||
fallthrough = self.registryValue('fallthrough', channel)
|
||||
def do(type):
|
||||
cap = ircdb.makeChannelCapability(channel, type)
|
||||
if ircdb.checkCapability(msg.prefix, cap,
|
||||
ignoreOwner=not self.registryValue('owner')):
|
||||
if self.registryValue(type, channel):
|
||||
self.log.info('Scheduling auto-%s of %s in %s.',
|
||||
type, msg.prefix, channel)
|
||||
msgmaker = getattr(ircmsgs, type)
|
||||
schedule_msg(msgmaker(channel, msg.nick))
|
||||
raise Continue # Even if fallthrough, let's only do one.
|
||||
elif not fallthrough:
|
||||
self.log.debug('%s has %s, but supybot.plugins.AutoMode.%s'
|
||||
' is not enabled in %s, refusing to fall '
|
||||
'through.', msg.prefix, cap, type, channel)
|
||||
raise Continue
|
||||
try:
|
||||
if ircdb.checkCapability(msg.prefix, cap,
|
||||
ignoreOwner=not self.registryValue('owner')):
|
||||
if self.registryValue(type, channel):
|
||||
self.log.info('Scheduling auto-%s of %s in %s.',
|
||||
type, msg.prefix, channel)
|
||||
msgmaker = getattr(ircmsgs, type)
|
||||
schedule_msg(msgmaker(channel, msg.nick))
|
||||
raise Continue # Even if fallthrough, let's only do one.
|
||||
elif not fallthrough:
|
||||
self.log.debug('%s has %s, but supybot.plugins.AutoMode.%s'
|
||||
' is not enabled in %s, refusing to fall '
|
||||
'through.', msg.prefix, cap, type, channel)
|
||||
raise Continue
|
||||
except KeyError:
|
||||
pass
|
||||
def schedule_msg(msg):
|
||||
def f():
|
||||
irc.queueMsg(msg)
|
||||
|
Loading…
Reference in New Issue
Block a user