mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 14:14:37 +01:00
Added extra logging to Enforcer in the case where it's not started.
This commit is contained in:
parent
90d1a55f6c
commit
f137b21dcf
@ -86,6 +86,7 @@ class Enforcer(callbacks.Privmsg):
|
||||
|
||||
def doJoin(self, irc, msg):
|
||||
if not self.started:
|
||||
debug.msg('Enforcer not started.', 'normal')
|
||||
return
|
||||
channel = msg.args[0]
|
||||
c = ircdb.channels.getChannel(channel)
|
||||
@ -101,6 +102,7 @@ class Enforcer(callbacks.Privmsg):
|
||||
|
||||
def doTopic(self, irc, msg):
|
||||
if not self.started:
|
||||
debug.msg('Enforcer not started.', 'normal')
|
||||
return
|
||||
channel = msg.args[0]
|
||||
topic = msg.args[1]
|
||||
@ -119,6 +121,7 @@ class Enforcer(callbacks.Privmsg):
|
||||
def do332(self, irc, msg):
|
||||
# This command gets sent right after joining a channel.
|
||||
if not self.started:
|
||||
debug.msg('Enforcer not started.', 'normal')
|
||||
return
|
||||
(channel, topic) = msg.args[1:]
|
||||
self.topics[channel] = topic
|
||||
@ -133,6 +136,7 @@ class Enforcer(callbacks.Privmsg):
|
||||
|
||||
def doKick(self, irc, msg):
|
||||
if not self.started:
|
||||
debug.msg('Enforcer not started.', 'normal')
|
||||
return
|
||||
channel = msg.args[0]
|
||||
kicked = msg.args[1].split(',')
|
||||
@ -157,6 +161,7 @@ class Enforcer(callbacks.Privmsg):
|
||||
|
||||
def doMode(self, irc, msg):
|
||||
if not self.started:
|
||||
debug.msg('Enforcer not started.', 'normal')
|
||||
return
|
||||
channel = msg.args[0]
|
||||
if not ircutils.isChannel(channel):
|
||||
@ -216,10 +221,12 @@ class Enforcer(callbacks.Privmsg):
|
||||
irc.queueMsg(ircmsgs.deop(channel, msg.nick))
|
||||
|
||||
def __call__(self, irc, msg):
|
||||
if self.started and msg.prefix == self.chanserv:
|
||||
return
|
||||
else:
|
||||
if self.started:
|
||||
if msg.prefix != self.chanserv and msg.nick != msg.prefix:
|
||||
return callbacks.Privmsg.__call__(self, irc, msg)
|
||||
else:
|
||||
debug.msg('Enforcer plugin not started. '
|
||||
'Give the bot the startenforcer command.', 'normal')
|
||||
|
||||
|
||||
Class = Enforcer
|
||||
|
Loading…
Reference in New Issue
Block a user