how to handle "unknown interaction" error
if the "unknown interaction" error occurs, should i try to reply to the interaction again or wut?
i think the error occurs when the user is lagging
7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!should i try to reply to the interaction again or wut?no, you can't do anything with that interaction anymore as it's now "Unknown" for discord (it doesn't exist anymore), you should just log it or maybe send a message to the channel saying something failed if that works for you
i think the error occurs when the user is laggingmost of the time it actually happens because of your bot lagging in some way (either the bot itself or network lag) and not being able to respond to the interaction before it expires, but there can be other reasons as stated below
Common causes of
DiscordAPIError[10062]: Unknown interaction
:
- Initial response took more than 3 seconds ➞ defer the response *.
- Wrong interaction object inside a collector.
- Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance)
* Note: you cannot defer modal or autocomplete value responsesas noted, to avoid it defer or reply as early as possible, but if even a defer isn't arriving on time then something could be wrong in your bot or your network
i see, but would i be able to access the channel object if the interaction is unknown?
yeah the variable doesn't update in real time or anything
you just can't do anything on discord with the interaction itself, eg replying, deferring
but you can still do stuff with the channel, user, etc
aight thanks