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)