From 18ea1dee4db4c71e109dd65ccd7b502da5d53bac Mon Sep 17 00:00:00 2001 From: James Vega Date: Tue, 4 Jan 2005 17:01:35 +0000 Subject: [PATCH] Fix my last broken commit. Gotta have variables around before you can use them. --- plugins/Infobot.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/Infobot.py b/plugins/Infobot.py index f07223636..a6cbe9818 100755 --- a/plugins/Infobot.py +++ b/plugins/Infobot.py @@ -480,7 +480,13 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp): def reset(self): self.db.close() - def error(self, s): + def error(self, s, irc=None, msg=None): + if irc is None: + assert self.irc is not None + irc = self.irc + if msg is None: + assert self.msg is not None + msg = self.msg if msg.repliedTo: self.log.debug('Already replied, not replying again.') return @@ -490,15 +496,15 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp): self.log.warning(s) def reply(self, s, irc=None, msg=None, action=False, substitute=True): - if msg.repliedTo: - self.log.debug('Already replied, not replying again.') - return if irc is None: assert self.irc is not None irc = self.irc if msg is None: assert self.msg is not None msg = self.msg + if msg.repliedTo: + self.log.debug('Already replied, not replying again.') + return if substitute: s = ircutils.standardSubstitute(irc, msg, s) irc.reply(s, prefixName=False, action=action, msg=msg)