diff --git a/pinhook/bot.py b/pinhook/bot.py index d083a34..19aaa03 100644 --- a/pinhook/bot.py +++ b/pinhook/bot.py @@ -184,7 +184,7 @@ class Bot(irc.bot.SingleServerIRCBot): for lstnr in pinhook.plugin.lstnrs: try: self.logger.debug('whispering to listener: {}'.format(lstnr)) - output = pinhook.plugin.lstnrs[lstnr](self.Message( + listen_output = pinhook.plugin.lstnrs[lstnr](self.Message( channel=chan, text=text, nick_list=nick_list, @@ -196,10 +196,12 @@ class Bot(irc.bot.SingleServerIRCBot): ops=self.ops, logger=self.logger )) - self.logger.debug(output.msg_type) - self.logger.debug(output.msg) + self.logger.debug(listen_output.msg) + if listen_output: + output = listen_output except Exception as e: self.logger.exception('issue with listener {}'.format(lstnr)) + self.logger.debug(f'returning output: {output.msg}') return output def process_event(self, c, e): @@ -237,6 +239,7 @@ class Bot(irc.bot.SingleServerIRCBot): } output = self.call_plugins(**plugin_info) if output: + self.logger.debug(f'sending output: {output.msg}') self.process_output(c, chan, output) def process_output(self, c, chan, output):