]> kaliko git repositories - sid.git/blobdiff - sid/sid.py
Fixed missing bot method
[sid.git] / sid / sid.py
index 19ba57fdc2b2b38b2531fcdef62649b585e8656d..d74eaf89a7250d2b06e5ac7a3183e5913e0d1987 100644 (file)
@@ -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)