This short example will cover how to make slash commands within an ext.commands.Bot's extension and Cog ecosystem.
There will be 3 examples:
-
A Cog Group, which will house all sub-commmands and the Cog is the parent.
- This means the Cog class is regarded as the parent command, and all commands defined are "sub" commands.
e.g.
/cog sub_cmd
- This means the Cog class is regarded as the parent command, and all commands defined are "sub" commands.
e.g.
-
A free Cog, where all commands will be top-level.
- This means like:
i.e
/my_cmd
- This means like:
i.e
-
A hybrid of the two, for when you want to group them accordingly.
- So this will allow:
i.e
/parent sub_1,/parent sub_2and/hello
- So this will allow:
i.e
I added how this command would be invoked in the doc strings.
This does not account for the fact you still need to sync Bot.tree somewhere, please remember to do this.
N.B: Ping Umbra#0009 in the d.py server if you want to suggest edits/improvements.