K
Docs
API ReferenceEvent TypesForm submitted
🪟

Form submitted

modalSubmitINTERACTION_CREATE (MODAL_SUBMIT)Trigger

Fires when someone submits a pop-up form. Each answer arrives as {{form.values.<field custom id>}}. Works in Interaction Only mode.

On the canvas

This is what the trigger looks like in your bot's Triggers tab. The sparks listed are available in every node inside the linked flow.

🪟
Form submitted
modalSubmit
Trigger
Sparks in this flow
{{input.guild.id}}Your Discord server's unique ID
{{input.guild.name}}Your server's name
{{input.guild.memberCount}}How many members are in the server
{{form.customId}}Custom id of the form that was submitted
{{form.args}}Anything after the colon in the form's custom id
{{component.user.id}}Discord ID of whoever submitted the form
{{component.user.username}}Username of whoever submitted the form
{{component.channelId}}Channel the form was opened from

Available sparks

Use these in any piece config field inside flows triggered by this event.

SparkTypeDescription
{{input.guild.id}}stringYour Discord server's unique ID
{{input.guild.name}}stringYour server's name
{{input.guild.memberCount}}stringHow many members are in the server
{{form.customId}}stringCustom id of the form that was submitted
{{form.args}}stringAnything after the colon in the form's custom id
{{component.user.id}}stringDiscord ID of whoever submitted the form
{{component.user.username}}stringUsername of whoever submitted the form
{{component.channelId}}stringChannel the form was opened from
📐

In TypeScript, this would be…

Not something you need to write — Kitcord registers these listeners automatically from your Kit.

TypeScript
client.on("modalSubmit", () => { /* your flow */ });