[Twisted-Python] irc bot, reacting to: irc_ERR_NOSUCHNICK. after the code where the reactor was started

peter commercials24 at yahoo.de
Mon Oct 5 05:42:31 MDT 2015


my bot inherits from irc.IRCClient, when it sends a message to another 
user who isnt online irc_ERR_NOSUCHNICK(self, prefix, command) is called.
how can i react to that message, my code is called with:


class mybot(irc.IRCClient):
...
if __name__ == "__main__":

     factory = XdccBotFactory( channel, nickname, xdccbot, xdccrequests )
     reactor.connectTCP( server, 6667, factory )



in irc_ERR_NOSUCHNICK... i got:
     error_message = "%s bot is not connected to server" % 
now.strftime("%Y-%m-%d %H:%M:%S")
     log.warning(error_message)


which works.
but what i really would like to have is:


if __name__ == "__main__":

     factory = XdccBotFactory( channel, nickname, xdccbot, xdccrequests )
     reactor.connectTCP( server, 6667, factory )

     if "bot not online":
         "send message to antoher user"


so basically i need the information that irc_ERR_... was called after 
the reactor was started.
how do you do that?





More information about the Twisted-Python mailing list