$createApplicationCommand
$createApplicationCommand
will create an application command.
Usage
Parameters
Field | Type | Description | Required |
---|---|---|---|
guildID/global | string, number | Application command type. 1. global 2. specific guildID | true |
name | string | Application command name, must be lowercase. | true |
description | string | Application command description. | true |
defaultPermissions | boolean | If the command should follow the default permissions. | true |
allowDm? | boolean | Allow Direct Message execution. | true |
type? | string | The application command type. (slash/user/message) | false |
options? | string | Application command options. | false |
Application Command Option Type
NAME | ID | NOTE |
---|---|---|
SUB_COMMAND | 1 | |
SUB_COMMAND_GROUP | 2 | |
STRING | 3 | |
NUMBER | 4 | Any Number between -2^53 and 2^53 |
BOOLEAN | 5 | |
USER | 6 | |
CHANNEL | 7 | Includes all channel types + categories |
ROLE | 8 | |
MENTIONABLE | 9 | Includes users and roles |
NUMBER | 10 | Any double between -2^53 and 2^53 |
ATTACHMENT | 11 | attachment object |
You can find more information in the official documentation of Discord’s API.
Example(s)
Check the Slash Command/Interaction guide for more information about slash commands!
This will create a slash command without options: