From ad4460f8abccaa2a5dfc15532c9529f77a641138 Mon Sep 17 00:00:00 2001 From: kaliko Date: Fri, 24 Mar 2023 16:05:21 +0100 Subject: [PATCH] Fixed missing bot method --- sid/sid.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.39.2