Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
Namediscordinteraction
Related Guide Pagehttps://guide.denizenscript.com/guides/expanding/ddiscordbot.html
Syntaxdiscordinteraction [defer/reply/delete] [interaction:<interaction>] (ephemeral) (rows:<rows>) (<message>) (embed:<embed>|...) (attach_files:<map>)
Short DescriptionManages Discord interactions.
Full DescriptionManages Discord interactions.

You can defer, reply to, edit, or delete an interaction. These instructions all require the "interaction" argument.

The "ephemeral" argument can be used to have the reply message be visible to that one user.

You can defer an interaction before replying, which is useful if your reply may take more than a few seconds to be selected.
If you defer, the 'ephemeral' option can only be set by the defer - you cannot change it with the later reply.
Replying to an interaction uses similar logic to normal messaging. See Command:discordmessage.
If you deferred without using 'ephemeral', the 'delete' option will delete the "Thinking..." message.
Ephemeral replies cannot have files.

Slash commands, and replies to interactions, have limitations. See 🔗https://gist.github.com/MinnDevelopment/b883b078fdb69d0e568249cc8bf37fe9.

Generally used alongside Command:discordcommand

The command can be ~waited for. See Language:~waitable.
Related Tags<entry[saveName].command> returns the DiscordCommandTag of a slash command upon creation, when the command is ~waited for.
Usage Example
# Use to quickly reply to a slash command interaction.
- discordinteraction reply interaction:<context.interaction> "hello!"
Usage Example
# Use to defer and reply to a slash command interaction.
- ~discordinteraction defer interaction:<context.interaction>
- discordinteraction reply interaction:<context.interaction> <context.options.get[hello].if_null[world]>
Usage Example
# Use to defer and reply to an interaction ephemerally.
- ~discordinteraction defer interaction:<context.interaction> ephemeral:true
- discordinteraction reply interaction:<context.interaction> "Shh, don't tell anyone!"
Groupexternal
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordInteractionCommand.java#L31