mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Fix my last broken commit. Gotta have variables around before you can use
them.
This commit is contained in:
parent
1aa615850b
commit
18ea1dee4d
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user