Fix my last broken commit. Gotta have variables around before you can use

them.
This commit is contained in:
James Vega 2005-01-04 17:01:35 +00:00
parent 1aa615850b
commit 18ea1dee4d

View File

@ -480,7 +480,13 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
def reset(self): def reset(self):
self.db.close() 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: if msg.repliedTo:
self.log.debug('Already replied, not replying again.') self.log.debug('Already replied, not replying again.')
return return
@ -490,15 +496,15 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
self.log.warning(s) self.log.warning(s)
def reply(self, s, irc=None, msg=None, action=False, substitute=True): 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: if irc is None:
assert self.irc is not None assert self.irc is not None
irc = self.irc irc = self.irc
if msg is None: if msg is None:
assert self.msg is not None assert self.msg is not None
msg = self.msg msg = self.msg
if msg.repliedTo:
self.log.debug('Already replied, not replying again.')
return
if substitute: if substitute:
s = ircutils.standardSubstitute(irc, msg, s) s = ircutils.standardSubstitute(irc, msg, s)
irc.reply(s, prefixName=False, action=action, msg=msg) irc.reply(s, prefixName=False, action=action, msg=msg)