Subcommands
Table of Contents
Sub commands
Sub-commands are apart of slash commands and are used to add as the name already suggest sub commands to the regular slash command. Which does not only “bypass” the slash command limit but also allows you to properly structure your application commands.
Creating Application Commands
Field | Type | Description | Required |
---|---|---|---|
guildID/global | string, number | The type of application command, either for every guild (global) or for one specific guild (specific guildID). | true |
name | string, number | The actual slash command name that will be visible to the user. | true |
description | string, number | The slash command description that will be visible to the user. | true |
defaultPermission | string | If the application command should synchronize to the default permissions. | true |
type | string | The application command type (explained below) | true |
options? | object | Slash commands options. | true |
Examples of creating Application Commands with sub commands
Creating Sub Commands with options
Creating sub commands with options or choices work basically the same as any other.
That would for example add two options called “user” and “reason”, where reason is type 3, string and user type 6, mention (user).
Replying to Sub commands
This would only make the bot reply to the “ban” sub-command, you can return the sub-command with $interactionData[options._subcommand]
.