var trigger = modal_submit(Args{custom_id: "report_modal"})
func main() {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Custom ID: " + trigger.custom_id,
})
}
Modal Submit
Triggers when a user submits a modal.
- Interaction trigger: the flow can reply to the user directly, with messages, modals and more.
Options
Modal custom ID to listen for. Supports `*` wildcard matching (e.g. `report_*`).
Example: report_modal
Outputs
Custom ID of the submitted modal.
Example: report_modal
If the Custom ID input uses a single `*` wildcard, this is the matched portion of the submitted modal Custom ID.
Example: 123
ID of the user who submitted the modal.
Example: 123456789012345678
Username of the user who submitted the modal.
Example: johndoe
Avatar URL of the user who submitted the modal.
Example: https://cdn.discordapp.com/avatars/123/abc.png
Channel where the modal was submitted.
Example: 123456789012345678
Server where the modal was submitted.
Example: 123456789012345678
ID of the application that received this interaction.
Example: 123456789012345678
Unique interaction ID for this modal submit.
Example: 123456789012345678
Token for this interaction, useful for webhook follow-up/edit operations.
Example: aW50ZXJhY3Rpb25fdG9rZW4
Permissions the bot/application had in the interaction channel, as a Discord bitfield string.
Example: 274877990912
Discord locale of the user who submitted the modal.
Example: en-US
Preferred locale of the server where the modal was submitted, when available.
Example: en-US
Where the interaction was used (`server`, `bot_dm`, or `private_channel`).
Example: server
Message ID if the modal originated from a message component.
Example: 123456789012345678
JSON object of submitted modal values keyed by component custom_id.
Example: {"bug_reason":"something broke","severity":"high"}
Value of the first submitted modal field, in the order shown to the user.
Example: something broke
Value of the second submitted modal field, in the order shown to the user.
Example: high
Value of the third submitted modal field, in the order shown to the user.
Example: extra details
Value of the fourth submitted modal field, in the order shown to the user.
Example: follow-up info
Value of the fifth submitted modal field, in the order shown to the user.
Example: final note
Number of submitted input/select components extracted from the modal.
Example: 2
Use this trigger in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
modal_submit- Interaction trigger: blocks that respond to interactions (replies, modals, ...) can be used in its flows.
Options
| Field | InventScript name | Value |
|---|---|---|
| Custom ID | custom_id | e.g. "report_modal" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Custom ID | custom_id | e.g. "report_modal" |
| Wildcard Value | wildcard_value | e.g. "123" |
| User ID | user_id | e.g. "123456789012345678" |
| Username | username | e.g. "johndoe" |
| User Avatar URL | user_avatar | e.g. "https://cdn.discordapp.com/avatars/123/abc.png" |
| Channel ID | channel_id | e.g. "123456789012345678" |
| Server ID | server_id | e.g. "123456789012345678" |
| Application ID | application_id | e.g. "123456789012345678" |
| Interaction ID | interaction_id | e.g. "123456789012345678" |
| Interaction Token | interaction_token | e.g. "aW50ZXJhY3Rpb25fdG9rZW4" |
| App Permissions | app_permissions | e.g. "274877990912" |
| User Locale | user_locale | e.g. "en-US" |
| Server Locale | server_locale | e.g. "en-US" |
| Interaction Context | interaction_context | e.g. "server" |
| Message ID | message_id | e.g. "123456789012345678" |
| Values JSON | values_json | e.g. "{\"bug_reason\":\"something broke\",\"severity\":\"high\"}" |
| Field 1 | field_1 | e.g. "something broke" |
| Field 2 | field_2 | e.g. "high" |
| Field 3 | field_3 | e.g. "extra details" |
| Field 4 | field_4 | e.g. "follow-up info" |
| Field 5 | field_5 | e.g. "final note" |
| Component Count | component_count | e.g. "2" |