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)