def _register_meta_commands(self): ''' Registers the "meta" commands, i.e. those handled by the bot itself. ''' for cmd, doc in ext.BOT_COMMANDS.iteritems(): func = functools.partial(self._handle_command, cmd) func.__doc__ = doc ext.register_command(cmd, func)
def __init__(self, *args, **kwargs): ''' Initializer. ''' self.nickname = config.nickname for cmd, doc in ext.BOT_COMMANDS.iteritems(): func = functools.partial(self._handle_command, cmd) func.__doc__ = doc ext.register_command(cmd, func) self._import_commands() self._import_plugins()