Discord error 10062: Unknown interaction
Last verified against Discord Developer Docs - Opcodes and status codes
Unknown interactionWhat error 10062 means
In Discord itself this failure shows up as “The application did not respond” under a slash command, or “This interaction failed” on a button or menu. In your bot's logs the same event is error 10062, Unknown interaction, the moment the bot finally tries to answer.
You tried to respond to an interaction (slash command, button, select menu, modal) that Discord no longer recognizes. The overwhelming cause is timing. When a user triggers an interaction, Discord hands you a token and expects an initial response within 3 seconds. If nothing arrives in that window the interaction is discarded, and any later attempt to reply with that token returns 10062.
The 3 seconds start when Discord creates the interaction, not when your code receives it. Network latency, a slow event loop, a cold-started serverless function, or a synchronous database call before the reply all eat into the budget. Bots that work fine on a laptop and fail in production are usually losing the extra few hundred milliseconds of hosting latency.
The fix is not to be faster; it is to acknowledge first. Sending a deferred response (type 5, DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE, or type 6 for component updates) counts as the initial response. The user sees a "thinking" state and you then have 15 minutes to edit the reply via the interaction webhook.
The pattern is two lines in any maintained library, with the acknowledgement before every piece of I/O:
// discord.js - ack within 3 seconds, then take up to 15 minutes
await interaction.deferReply();
const answer = await doSlowWork();
await interaction.editReply(answer);
# discord.py - same shape
await interaction.response.defer()
answer = await do_slow_work()
await interaction.edit_original_response(content=answer)Note what the defer buys you: the interaction token stays usable for 15 minutes for editing the original response and posting follow-ups through the webhook routes. It does not remove the 3-second deadline; it satisfies it. If even the defer arrives late, because the process was cold-starting or the event loop was blocked, you still get 10062, which is why the defer must be the first awaited call in the handler rather than merely an early one.
What it looks like
{
"message": "Unknown interaction",
"code": 10062
}Why it happens
- Handler performs slow work (database, HTTP call, AI model) before sending any response
- Serverless or container cold start exceeds 3 seconds
- Bot process restarted between receiving the interaction and replying
- Responding twice with different interaction tokens after a retry
- Clock or event-loop starvation on the host (blocked by a synchronous task)
- The bot is offline or still reconnecting, so nothing receives the interaction at all; the slash command still appears because commands are registered on the application, not the running process
- The handler throws before it replies (an unhandled exception or rejected promise), so the 3-second window passes with no response
- A button or select menu belongs to a message whose collector or persistent view no longer exists after a restart
How to fix Discord error 10062
- 1Call deferReply() / response.defer() / send type 5 as the very first statement in the handler, before any await
- 2Do the real work, then edit the deferred response with PATCH /webhooks/{application.id}/{interaction.token}/messages/@original
- 3For buttons that only change the original message, use type 6 DEFERRED_UPDATE_MESSAGE so no loading state appears
- 4Measure time from interaction.id (a snowflake with a timestamp) to your first response; alert if it exceeds 2 seconds
- 5On HTTP-interaction (webhook-style) bots, make sure your endpoint returns the ack synchronously and queues the work
- 6Check whether the bot is actually connected: if it shows offline, or every command fails, fix the gateway connection first (token, intents, crashes) before tuning handler speed
- 7Wrap each handler in try/catch and reply with an ephemeral error inside the catch, so a crash still answers within the window
- 8For buttons and menus that must survive restarts, register persistent handlers by custom_id at startup (discord.py: add_view with timeout=None; discord.js: a global interactionCreate handler) instead of message-scoped collectors
- 9For an Interactions Endpoint URL: answer PING (type 1) with PONG (type 1), verify the Ed25519 signature and return 401 on failure, and keep the endpoint warm; Discord removes an endpoint URL that keeps failing its checks
How to stop it recurring
Adopt defer-then-edit as the default shape for every command handler that does anything beyond returning a constant string. Keep the code path between receiving the event and sending the ack free of I/O. If you run the bot serverless, keep a warm instance or move interaction handling to a long-lived process.
The 3-second and 15-minute windows are listed with sources on the Discord limits page, and the "application did not respond" section of Discord bot not responding walks the same fix through a full bot.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 10062 - quick answers
What does Discord error 10062 mean?
In Discord itself this failure shows up as “The application did not respond” under a slash command, or “This interaction failed” on a button or menu. In your bot's logs the same event is error 10062, Unknown interaction , the moment the bot finally tries to answer. You tried to respond to an interaction (slash command, button, select menu, modal) that Discord no longer recognizes. The overwhelming cause is timing.
How do I fix Discord error 10062?
1. Call deferReply() / response.defer() / send type 5 as the very first statement in the handler, before any await 2. Do the real work, then edit the deferred response with PATCH /webhooks/{application.id}/{interaction.token}/messages/@original 3. For buttons that only change the original message, use type 6 DEFERRED_UPDATE_MESSAGE so no loading state appears 4. Measure time from interaction.id (a snowflake with a timestamp) to your first response; alert if it exceeds 2…
Should I retry after error 10062?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.