diff --git a/bot.py b/bot.py index 35914b3..7cd1ad2 100644 --- a/bot.py +++ b/bot.py @@ -37,6 +37,12 @@ def __init__(self, config, db, on_connect_cb): else: super(IRCBot, self).__init__(self.__servers, self.__config.NICK, self.__config.NICK) + def on_kick(self, connection, event): + """Join the correct channel again""" + if irc.client.is_channel(self.__config.CHANNEL): + time.sleep(31) + connection.join(self.__config.CHANNEL) + def on_welcome(self, connection, event): """Join the correct channel upon connecting""" if irc.client.is_channel(self.__config.CHANNEL):