mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[V3 Core] Command group automatic help (#1790)
* decorator inheritence * black format * add autohelp * modify commands to use autohelp
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user