summaryrefslogtreecommitdiff
path: root/command_utils.py
diff options
context:
space:
mode:
authorNatrixAeria <upezu@student.kit.edu>2020-09-28 02:48:38 +0200
committerNatrixAeria <upezu@student.kit.edu>2020-09-28 02:48:38 +0200
commit89e0c7df2b88daf83b6a415c1ab2b95e2d6bc46d (patch)
treec2ded0c4b7ff7a76a5a399d41e0df35f1f52ef7b /command_utils.py
parent778b54f50f81151cbd1bd2e62f5c6d69c4ca0cf0 (diff)
Alter command property syntax
Diffstat (limited to 'command_utils.py')
-rw-r--r--command_utils.py28
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