Interactions & commands overview
Status
Stable· Last verified 2026-07-11 · APIv10· Sources Interactions overview, Receiving & responding, Application commands
An interaction is any moment a user invokes your app: running a command,
clicking a button, choosing from a select menu, or submitting a modal.
Interactions are the modern, first-class way to build app UX — they replaced
ad-hoc “prefix commands” that scraped message text (which now also require the
privileged MESSAGE_CONTENT intent — see Intents).
In this section
Section titled “In this section”| Page | What it covers |
|---|---|
| Interaction lifecycle | The 5 interaction types, the 3-second ACK, deferral, the 15-minute token |
| Signature verification | The Ed25519 flow for HTTP endpoints, step by step, with pitfalls |
| Slash commands | Command types, options, autocomplete, localization, registration |
| Components: buttons, selects, modals | Interactive components and Components V2 |
| Responses & follow-ups | Response types, ephemeral, editing, follow-up messages |
| Security pitfalls | The mistakes that break or expose interaction apps |
The command types
Section titled “The command types”| Type | Value | How the user triggers it | Example |
|---|---|---|---|
Slash command (CHAT_INPUT) |
1 |
Types /name with typed options/autocomplete |
/ban user:@x reason:"spam" |
User command (USER) |
2 |
Right-clicks a user → Apps | “Show avatar” |
Message command (MESSAGE) |
3 |
Right-clicks a message → Apps | “Report”, “Translate” |
Commands can be global (all installs) or guild-scoped (one server, updates instantly — ideal for development). Full detail: Slash commands.
Components (interactive UI)
Section titled “Components (interactive UI)”Beyond commands, messages carry interactive components — buttons, select
menus (string/user/role/mentionable/channel), and pop-up modals. Discord’s
Components V2 system (opt-in per message via the IS_COMPONENTS_V2 flag,
1 << 15) additionally lets you compose the whole message from components instead
of content + embeds. See Components.
Two ways to receive interactions
Section titled “Two ways to receive interactions”| HTTP Interactions Endpoint | Gateway | |
|---|---|---|
| Transport | Discord POSTs to your URL |
Delivered as gateway events |
| Hosting | Serverless-friendly, stateless | Needs a persistent socket |
| Must verify Ed25519 signature | Yes (mandatory) | No (already authenticated) |
| Good when | You don’t want an always-on process | You already run a bot for events |
The endpoint path runs on Workers/Lambda/Vercel with no socket — but you must
verify every request’s signature (details).
Runnable: interaction-endpoint
(HTTP) and bot-gateway-minimal
(gateway).
Registering commands (quick reference)
Section titled “Registering commands (quick reference)”Commands are created via REST, not the portal — usually once at deploy time. Guild-scoped updates are instant; global ones take time to propagate:
# Bulk-overwrite this app's guild commands (instant during development):curl -X PUT \ "https://discord.com/api/v10/applications/$DISCORD_APPLICATION_ID/guilds/$DISCORD_TEST_GUILD_ID/commands" \ -H "Authorization: Bot $DISCORD_BOT_TOKEN" \ -H "Content-Type: application/json" \ -d '[{ "name": "ping", "description": "Replies with pong", "type": 1 }]'Swap /guilds/{id}/commands for /commands to register globally. More:
Slash commands → registration.
Start with the interaction lifecycle — the timing rules underpin everything else.