$createApplicationCommand
$createApplicationCommand
will create an application command.
Usage
Parameters
Field | Type | Description | Required |
---|---|---|---|
type | 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 |
permissions? | string | If the command should be restricted to certain permissions. | false |
integrationType? | string | The application command integration type. 1. user 2. guild | false |
context? | string | The application command context. 1. botdm 2. dm 3. guild | false |
type? | string | The application command type. 1. slash 2. user 3. 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! You can also use the Application Command Creator to easily create your own custom application commands for your application.
This will create a guild slash command without options:
This will create a guild slash command with restricted permissions, without options: