Unknown Interaction
DiscordAPIError[10062]: Unknown interaction
at handleErrors (C:\Users\Anwender\Desktop\Hansis Manager\node_modules@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\Anwender\Desktop\Hansis Manager\node_modules@discordjs\rest\dist\index.js:786:23)
at async _REST.request (C:\Users\Anwender\Desktop\Hansis Manager\node_modules@discordjs\rest\dist\index.js:1218:22)
at async ChatInputCommandInteraction.reply (C:\Users\Anwender\Desktop\Hansis Manager\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Object.execute (C:\Users\Anwender\Desktop\Hansis Manager\commands\moderation\ping.js:8:3)
at async Object.execute (C:\Users\Anwender\Desktop\Hansis Manager\events\interactionCreate.js:16:4) {
requestBody: { files: [], json: { type: 4, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
17 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!
- ✅
Marked as resolved by OPDespite an error being registered, the command is executed.
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 responsesLikely one of the reasons above, can't help much more unless you show code
user.js:
index.js:
Which script do you need so that you can help me?#
Well that would depends when the error occurs, does it happen when you run the users.js file or?
Yes
Have you tried any of the fixed mentioned here? https://discord.com/channels/222078108977594368/1172151893896745011/1172152171794550886
Yes..
But i have no idea
What did you try, show me the code changes
I have no idea what I should change in the code.
why do you have an event handler but still have a regular listener
I took it from the guide.
i'm pretty sure you just managed to register the even twice
the even handler does not tell you to put your listeners inside it
your listeners should be separate files
ok
That means?
that you should have your event listeners in separate files
Okay
It works!
Thank you very much! :D