Skip to content

Subcommands in Cog #403

Answered by DenverCoder1
zuhairp asked this question in Q&A
Jan 29, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

It should work just like subcommands outside a cog

class TestCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @nextcord.slash_command(guild_ids=[TESTING_GUILD_ID], description="test")
    async def test_slash_command(self, interaction: nextcord.Interaction):
        pass

    @test_slash_command.subcommand(description="subcommand")
    async def subcommand(self, interaction: nextcord.Interaction):
        await interaction.send("subcommand")

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zuhairp
Comment options

@bmaxdk
Comment options

Answer selected by zuhairp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants