dc_create_application_command
dc_create_application_command(type, data, server?)#
Creates a slash command or a context menu command for the bot.
Blocking function
Invoking this function can freeze the game.
Use it in a task to avoid freezing your game.
Input parameters#
| Parameter | Type | Description |
|---|---|---|
type |
String | The type of command to create. |
data |
(See command types) | The schema to be used depends on the type. |
server |
Server | The server to create the command in. If left empty, the command will be available in all servers the bot is in. |
Command types#
Depending on the type, this function expects different schemas for data:
| String | Schema |
|---|---|
slash_command |
Slash command builder object |
user_context_menu |
User context menu builder object |
message_context_menu |
Message context menu builder object |
Output values#
Return values#
- The created application command value.
Uncaught exceptions #
- Throws an exception on failure.