Esempio n. 1
0
 def die(self):
     """ Kills the bot.
     """
     PlugBot.stop(self)
     CommandBot.stop(self)
     self.rooms = {}
     logging.info("Disconnecting bot")
     self.disconnect()
Esempio n. 2
0
    def rehash(self):
        """ Re-reads the config file, making appropriate runtime changes.
            Causes all plugins to be reloaded (or unloaded).
            The XMPP stream and MUC rooms will not be disconnected.
        """
        logging.info("Rehashing started")
        modules = self.cmd_plugins.get_modules()
        CommandBot.pause(self)
        PlugBot.stop(self)

        logging.info("Reloading config file")
        self.botconfig = self.load_config(self.config_file)
        for module in modules:
            reload(module)
        CommandBot.reset(self)

        PlugBot.start(self)
        CommandBot.resume(self)
        self.join_rooms()