3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

utils: add error() to use classes.py's irc.error()

This commit is contained in:
Ken Spencer 2016-11-19 01:01:23 -05:00 committed by James Lu
parent c450d71f84
commit fdd4135632

View File

@ -294,7 +294,15 @@ class ServiceBot():
return
irc.reply(text, notice=notice, source=servuid, private=private)
def error(self, irc, text, notice=False, private=False):
"""Replies with an error, as the service in question."""
servuid = self.uids.get(irc.name)
if not servuid:
log.warning("(%s) Possible desync? UID for service %s doesn't exist!", irc.name, self.name)
return
irc.error(text, notice=notice, source=servuid, private=private)
def call_cmd(self, irc, source, text, called_in=None):
"""
Calls a PyLink bot command. source is the caller's UID, and text is the