Added a safety measure to keep the bot from looping message itself.

This commit is contained in:
Jeremy Fincher 2004-08-21 20:03:56 +00:00
parent 4a36ef95ec
commit 28e79eecfd
1 changed files with 6 additions and 0 deletions

View File

@ -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)