From 89e0c7df2b88daf83b6a415c1ab2b95e2d6bc46d Mon Sep 17 00:00:00 2001 From: NatrixAeria Date: Mon, 28 Sep 2020 02:48:38 +0200 Subject: Alter command property syntax --- command_utils.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'command_utils.py') 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 -- cgit v1.3.1