Modal Submit

Interaction triggerInteractions

Triggers when a user submits a modal.

  • Interaction trigger: the flow can reply to the user directly, with messages, modals and more.

Options

Custom IDRequired

Modal custom ID to listen for. Supports `*` wildcard matching (e.g. `report_*`).

Example: report_modal

Outputs

Custom ID

Custom ID of the submitted modal.

Example: report_modal

Wildcard Value

If the Custom ID input uses a single `*` wildcard, this is the matched portion of the submitted modal Custom ID.

Example: 123

User ID

ID of the user who submitted the modal.

Example: 123456789012345678

Username

Username of the user who submitted the modal.

Example: johndoe

User Avatar URL

Avatar URL of the user who submitted the modal.

Example: https://cdn.discordapp.com/avatars/123/abc.png

Channel ID

Channel where the modal was submitted.

Example: 123456789012345678

Server ID

Server where the modal was submitted.

Example: 123456789012345678

Application ID

ID of the application that received this interaction.

Example: 123456789012345678

Interaction ID

Unique interaction ID for this modal submit.

Example: 123456789012345678

Interaction Token

Token for this interaction, useful for webhook follow-up/edit operations.

Example: aW50ZXJhY3Rpb25fdG9rZW4

App Permissions

Permissions the bot/application had in the interaction channel, as a Discord bitfield string.

Example: 274877990912

User Locale

Discord locale of the user who submitted the modal.

Example: en-US

Server Locale

Preferred locale of the server where the modal was submitted, when available.

Example: en-US

Interaction Context

Where the interaction was used (`server`, `bot_dm`, or `private_channel`).

Example: server

Message ID

Message ID if the modal originated from a message component.

Example: 123456789012345678

Values JSON

JSON object of submitted modal values keyed by component custom_id.

Example: {"bug_reason":"something broke","severity":"high"}

Field 1

Value of the first submitted modal field, in the order shown to the user.

Example: something broke

Field 2

Value of the second submitted modal field, in the order shown to the user.

Example: high

Field 3

Value of the third submitted modal field, in the order shown to the user.

Example: extra details

Field 4

Value of the fourth submitted modal field, in the order shown to the user.

Example: follow-up info

Field 5

Value of the fifth submitted modal field, in the order shown to the user.

Example: final note

Component Count

Number of submitted input/select components extracted from the modal.

Example: 2

Build a bot using triggers like Modal Submit

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

ID: modal_submit
  • Interaction trigger: blocks that respond to interactions (replies, modals, ...) can be used in its flows.

Options

FieldInventScript nameValue
Custom IDcustom_ide.g. "report_modal"

Outputs

FieldInventScript nameValue
Custom IDcustom_ide.g. "report_modal"
Wildcard Valuewildcard_valuee.g. "123"
User IDuser_ide.g. "123456789012345678"
Usernameusernamee.g. "johndoe"
User Avatar URLuser_avatare.g. "https://cdn.discordapp.com/avatars/123/abc.png"
Channel IDchannel_ide.g. "123456789012345678"
Server IDserver_ide.g. "123456789012345678"
Application IDapplication_ide.g. "123456789012345678"
Interaction IDinteraction_ide.g. "123456789012345678"
Interaction Tokeninteraction_tokene.g. "aW50ZXJhY3Rpb25fdG9rZW4"
App Permissionsapp_permissionse.g. "274877990912"
User Localeuser_localee.g. "en-US"
Server Localeserver_localee.g. "en-US"
Interaction Contextinteraction_contexte.g. "server"
Message IDmessage_ide.g. "123456789012345678"
Values JSONvalues_jsone.g. "{\"bug_reason\":\"something broke\",\"severity\":\"high\"}"
Field 1field_1e.g. "something broke"
Field 2field_2e.g. "high"
Field 3field_3e.g. "extra details"
Field 4field_4e.g. "follow-up info"
Field 5field_5e.g. "final note"
Component Countcomponent_counte.g. "2"

Example InventScript

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,
	})
}

More interactions triggers