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...
Namediscordmodal
Related Guide Pagehttps://guide.denizenscript.com/guides/expanding/ddiscordbot.html
Syntaxdiscordmodal [interaction:<interaction>] [name:<name>] [rows:<rows>] (title:<title>)
Short DescriptionManages Discord modals.
Full DescriptionWith this command you can respond to an interaction using a modal.
A "modal" is a popup window that presents the user with a form to fill out.

You can specify the modal's internal name for matching with in events.
You can specify the title as text to display to the user.
You can specify rows of user-inputs using ObjectType:DiscordTextInputTag. At time of writing, Selection input is not supported.

You can listen to the responses to forms using Event:discord modal submitted.

You cannot defer an interaction before using a modal. It must be sent immediately.

Note that the interaction can be any button or application command, but cannot be a modal submission - you cannot reply to a modal submit with a second modal.

The command can be ~waited for. See Language:~waitable.
Related TagsNone
Usage Example
# Use to create a modal that only requests one single direct text input.
- definemap rows:
     1:
         1: <discord_text_input.with[id].as[textinput].with[label].as[Type here!].with[style].as[short]>
- discordmodal interaction:<context.interaction> name:example_modal title:Modal! rows:<[rows]>
Groupexternal
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordModalCommand.java#L32