X-Git-Url: http://git.kaliko.me/?p=sid.git;a=blobdiff_plain;f=sid%2Fsid.py;fp=sid%2Fsid.py;h=d74eaf89a7250d2b06e5ac7a3183e5913e0d1987;hp=19ba57fdc2b2b38b2531fcdef62649b585e8656d;hb=ad4460f8abccaa2a5dfc15532c9529f77a641138;hpb=a27c7e2eaf79079f3eb6fdf5de98e4e9e335f548 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)