K
Docs
API ReferenceEvent TypesInteraction received

Interaction received

interactionCreateINTERACTION_CREATETrigger

Fires when a Discord interaction is received (slash commands use Spells instead).

When to use this
  • Non-slash interactions (buttons, menus) if wired in future flows

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.

Interaction received
interactionCreate
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
{{interaction.user.id}}Discord ID of who triggered the interaction
{{interaction.user.username}}Username of the person who triggered the interaction
{{interaction.channelId}}ID of the channel the interaction came from
{{interaction.type}}Interaction type (ChatInputCommand, Button, SelectMenu, etc.)

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
{{interaction.user.id}}stringDiscord ID of who triggered the interaction
{{interaction.user.username}}stringUsername of the person who triggered the interaction
{{interaction.channelId}}stringID of the channel the interaction came from
{{interaction.type}}stringInteraction type (ChatInputCommand, Button, SelectMenu, etc.)
📐

In TypeScript, this would be…

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

TypeScript
client.on("interactionCreate", (interaction) => {
  // {{interaction.user.id}}, {{interaction.type}}
});