# this a app command group # you can nest these up 1: # `/group group` = VALID # /group group group` = INVALID # etc... all invalid. # this example shows one way to do this, subclassing # the other is constructing an instance of app_commands.Group() # that one is shown in "free_function_commands-py" import discord from discord import app_commands # the @app_commands.guilds and others (including checks) can be used above the class # these will apply to ALL subcommand, subcommands cannot have invidual perms! @app_commands.guild_only() class Group(app_commands.Group): # subcommand of Group @app_commands.command() async def my_subcommand(self, interaction: discord.Interaction) -> None: await interaction.response.send_message("hello from the subcommand!") # nested group command group2 = app_commands.Group(name="group2", description="This a nested group!") # subcommand of group2 @group2.command() async def my_second_group_command(self, interaction: discord.Interaction) -> None: await interaction.response.send_message("hello from the second subcommand!") # unlike commands.GroupCog, you need to add this class to your tree yourself. tree.add_command(Group())