From: kaliko Date: Fri, 24 Mar 2023 15:05:21 +0000 (+0100) Subject: Fixed missing bot method X-Git-Tag: 0.4.0~6 X-Git-Url: http://git.kaliko.me/?p=sid.git;a=commitdiff_plain;h=ad4460f8abccaa2a5dfc15532c9529f77a641138 Fixed missing bot method --- diff --git a/sid/sid.py b/sid/sid.py index 19ba57f..d74eaf8 100644 --- a/sid/sid.py +++ b/sid/sid.py @@ -176,6 +176,15 @@ class MUCBot(slixmpp.ClientXMPP): log.debug('Registered command: %s', name) self.commands[name] = value + def unregister_bot_plugin(self, plugin): + for name, value in inspect.getmembers(plugin): + if inspect.ismethod(value) and \ + getattr(value, '_bot_command', False): + name = getattr(value, '_bot_command_name') + log.debug('Unegistered command: %s', name) + self.commands[name] = value + self.plugins.remove(plugin) + def foreach_plugin(self, method, *args, **kwds): for plugin in self.plugins: log.debug('calling %s for %s', method, plugin)