def add_command(self, command, permission):
if command in self:
raise CommandException('Cannot re-assign command ({command_name})'.format(command_name=command))
def decorator(method):
## Retrieves the functions argument count.
## Used to verify the client/say command is valid.
self[command] = (
method,
len(signature(method).parameters),
permission
)
def new(*args):
method(*args)
return new
return decorator
评论列表
文章目录