From fdd4135632a02bd9c987af36e61be139c13e41c0 Mon Sep 17 00:00:00 2001 From: Ken Spencer Date: Sat, 19 Nov 2016 01:01:23 -0500 Subject: [PATCH] utils: add error() to use classes.py's irc.error() --- utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils.py b/utils.py index 47093f2..4417a6b 100644 --- a/utils.py +++ b/utils.py @@ -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