fix issue with listeners not sending any output (#58)
This commit is contained in:
		
							parent
							
								
									836a696dc5
								
							
						
					
					
						commit
						81af6ba8bd
					
				@ -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):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user