mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Added a safety measure to keep the bot from looping message itself.
This commit is contained in:
parent
4a36ef95ec
commit
28e79eecfd
@ -164,6 +164,12 @@ class LogProxy(object):
|
||||
self.im_func = holder()
|
||||
self.im_func.func_name = 'log'
|
||||
|
||||
def inFilter(self, irc, msg):
|
||||
if msg.command == 'PRIVMSG' and msg.nick == irc.nick:
|
||||
self.log.warning('Somehow sent a message to myself, ignoring.')
|
||||
return None
|
||||
return msg
|
||||
|
||||
def __call__(self, irc, msg, args):
|
||||
text = privmsgs.getArgs(args)
|
||||
log.critical(text)
|
||||
|
Loading…
Reference in New Issue
Block a user