unknown interaction error
hey, i get the below error. I have tried to add an acknowledgement to the interaction, as we get the response from the API, so could take a while, but it still errors.
It's intermittent.
20 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!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 responses@polarwolvinny ❄🌈 i've tried to resolve these things listed but I cant get it to work
if its unknown even before you reach the defer you either have duplicate listeners/processes or its a host/network issue
it's intermittent, and only happens for some interactions which I can't understand
sounds like you are taking longer than 3s to send your initial response then
yeah so I have added this
and i'm using interaction followup to reply
im not sure what could be the issue
if its unknown before it reaches the defer its likely a network or host issue
how would I check this?
youre gonna have to ask your host for that
Here's the commands.js code, can you see any issues? if not I can share the bot.js
Theres your issue
That defer has no use at all
You have to defer at the top
Before doing any async stuff
ah okay, so I need to defer it before
async execute
?no, then interaction wont be defined
You have to defer first, before any of your other logic
okay cool, so defering it is the first thing I need to do after
async execute
?Yes
Then replace your .reply with editReply
cool thank you! looks to work locally!
@treble/luna i've pushed this to prod, however we're still getting these errors
this needs to be defer reply?
the other code I showed you was from commandsjs
so you are either replying to the same interaction twice, or it took longer than 3s to reply
if it's intermittent issue then it's more likely?
and we have that defer in now so i'm not sure
then indeed you are responding after 3 seconds