Name | discordcommand |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordcommand (id:<bot>) [create/delete] (group:<group>) (name:<name>) (type:{slash}/user/message) (description:<description>) (options:<options>) |
Short Description | Manages Discord application commands. |
Full Description | Manages Discord application commands.
You can create a new command, edit the permissions of an existing command, or delete an existing command. To create (or delete) a command in a specific Discord guild, use the "group" argument. If not present, a global command will be created. NOTE: Global commands take up to an hour to register. When creating, both a name and description are required. Commands can be slash commands - activated via typing "/", message commands - activated by right-clicking a message, or user commands - activated by right-clicking a user. "Description" and "options" are only valid for slash commands. The "options" argument controls the command parameters. It is a MapTag of ordered MapTags that can sometimes hold ordered MapTags. It is recommended to use definemap or a data script key when creating commands. All option MapTags must have "type", "name", and "description" keys, with an optional "required" key (defaulting to true). The "type" key can be one of: STRING, INTEGER, BOOLEAN, USER, CHANNEL, ROLE, MENTIONABLE, NUMBER, ATTACHMENT. Additionally, the option map can include a "choices" key, which is a MapTag of ordered MapTags that have a "name" (what displays to the user) and a "value" (what gets passed to the client). Instead of choices, the option map can also include an "autocomplete" key controlling whether dynamic suggestions can be provided to the client (defaulting to false). See on discord command autocomplete. Editing application command permissions has been moved to the "Integrations" section in the server settings. Read more about it here: https://discord.com/blog/slash-commands-permissions-discord-apps-bots You DO NOT need to create a command on startup every time! Once a command is created, it will persist until you delete it. Using the "create" instruction on an existing command will update it. Commands and replies to interactions have limitations. See https://gist.github.com/MinnDevelopment/b883b078fdb69d0e568249cc8bf37fe9. See also Discord's internal API documentation for commands: https://discord.com/developers/docs/interactions/application-commands Generally used alongside discordinteraction The command should usually be ~waited for. See ~waitable. |
Related Tags | <entry[saveName].command> returns the DiscordCommandTag of a command upon creation, when the command is ~waited for.
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordCommandCommand.java#L40 |