def __init__(self, config): BotBot.__init__(self, config.HOST, config.IDENTITY['nick'], config.IDENTITY['realname']) self.config = config self.d = Debug() # initialize PluginDispatcher and autoload modules self.plugin_dispatcher = PluginDispatcher(self, config.PATHS['plugins']) self.plugin_dispatcher.load_plugins(config.PLUGINS)
def quit(self, quit_reason=''): """Invokes the before_quit hook of all loaded plugins before the QUIT message is sent to the server.""" # invoke system hook self.plugin_dispatcher.invoke_all("before_quit") BotBot.quit(self, quit_reason)
def exit(self, exit_code=0): """Invokes the before_unload hook of all loaded plugins before the module gets unloaded.""" # invoke system hook self.plugin_dispatcher.invoke_all("before_unload") BotBot.exit(self, exit_code)
def handle_irc(self, msg): # handle "built in" event hooks BotBot.handle_irc(self, msg) # handle plugin event hooks self.plugin_dispatcher.handle_irc(msg)