[V3 Core] Command group automatic help (#1790)

* decorator inheritence

* black format

* add autohelp

* modify commands to use autohelp
This commit is contained in:
Michael H
2018-06-08 20:54:36 -04:00
committed by Will
parent ca19ecaefc
commit 17c7dd658d
19 changed files with 87 additions and 104 deletions

View File

@@ -141,14 +141,13 @@ class CustomCommands:
self.config.register_guild(commands={})
self.commandobj = CommandObj(config=self.config, bot=self.bot)
@commands.group(aliases=["cc"], no_pm=True)
@commands.group(aliases=["cc"], autohelp=True)
@commands.guild_only()
async def customcom(self, ctx: commands.Context):
"""Custom commands management"""
if not ctx.invoked_subcommand:
await ctx.send_help()
pass
@customcom.group(name="add")
@customcom.group(name="add", autohelp=True)
@checks.mod_or_permissions(administrator=True)
async def cc_add(self, ctx: commands.Context):
"""
@@ -166,8 +165,7 @@ class CustomCommands:
{server} message.guild
"""
if not ctx.invoked_subcommand or isinstance(ctx.invoked_subcommand, commands.Group):
await ctx.send_help()
pass
@cc_add.command(name="random")
@checks.mod_or_permissions(administrator=True)