diff options
| author | NatrixAeria <upezu@student.kit.edu> | 2020-09-28 02:48:38 +0200 |
|---|---|---|
| committer | NatrixAeria <upezu@student.kit.edu> | 2020-09-28 02:48:38 +0200 |
| commit | 89e0c7df2b88daf83b6a415c1ab2b95e2d6bc46d (patch) | |
| tree | c2ded0c4b7ff7a76a5a399d41e0df35f1f52ef7b /command_utils.py | |
| parent | 778b54f50f81151cbd1bd2e62f5c6d69c4ca0cf0 (diff) | |
Alter command property syntax
Diffstat (limited to 'command_utils.py')
| -rw-r--r-- | command_utils.py | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/command_utils.py b/command_utils.py index b679975..6a82e7b 100644 --- a/command_utils.py +++ b/command_utils.py @@ -50,24 +50,12 @@ class CommandClient(discord.Client, metaclass=CommandClientMeta): return await self.run_help(ctx) -class Command: - @classmethod - def names(cls, *names): - def meta(f): - f.command = True - f.names = names - return f - return meta - - @classmethod - def description(cls, description): - def meta(f): - f.command = True - f.description = description - return f - return meta - - @classmethod - def help_command(cls, f): - f.help_command = True +def command(names=[], description='', is_help=False): + def meta(f): + f.command = True + f.names = names + f.description = description + if is_help: + f.help_command = is_help return f + return meta |
