Unknown Interaction for buttons

Hey, im trying to create a message wich has buttons but it doesnt work. Sometimes it works and sometimes not. I get the error unknown interaction on a line which says
await interaction.deferReply();
await interaction.deferReply();
. How can that be? My Discord.js version: discord.js@14.11.0 . My node version: 18.12.0
7 Replies
d.js toolkit
d.js toolkit11mo ago
- 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!
McSimi.js
McSimi.js11mo ago
File i get error in
McSimi.js
McSimi.js11mo ago
Error:
d.js docs
d.js docs11mo ago
Common causes of DiscordAPIError[10062]: Unknown interaction: - Initial response took more than 3 seconds ➞ defer the response *. - Wrong interaction object inside a collector. * Note: you cannot defer modal or autocomplete value responses
McSimi.js
McSimi.js11mo ago
DiscordAPIError[10062]: Unknown interaction
at handleErrors (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:69:5)
at async Object.callback (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\src\commands\suggestion\suggest.js:41:5)
at async module.exports (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\src\events\interactionCreate\handleCommands.js:49:1)
at async Client.<anonymous> (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\src\handlers\eventHandler.js:17:5) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1136329200928817222/aW50ZXJhY3Rpb246MTEzNjMyOTIwMDkyODgxNzIyMjpmVThxQk41WVd3eExDaEozRmVVMlk5NGNYYTFFa2Z4cTUxdWFFZTBleXFYdURKbTR6RVhTUmY1MmxnTDIxQWdtWjBaTWZtR0p3SmtnR1N2dG4wUVVyMEZqSHBaQ3FYMjN2bUJKbGZ5N0VqbmYyYTZTSUw1aWRVMFI3Q1pCTVRpTw/callback'
}
DiscordAPIError[10062]: Unknown interaction
at handleErrors (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:69:5)
at async Object.callback (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\src\commands\suggestion\suggest.js:41:5)
at async module.exports (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\src\events\interactionCreate\handleCommands.js:49:1)
at async Client.<anonymous> (C:\Users\Simon\VSCode\super-neccecary\DISCORD\SimiBot\src\handlers\eventHandler.js:17:5) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1136329200928817222/aW50ZXJhY3Rpb246MTEzNjMyOTIwMDkyODgxNzIyMjpmVThxQk41WVd3eExDaEozRmVVMlk5NGNYYTFFa2Z4cTUxdWFFZTBleXFYdURKbTR6RVhTUmY1MmxnTDIxQWdtWjBaTWZtR0p3SmtnR1N2dG4wUVVyMEZqSHBaQ3FYMjN2bUJKbGZ5N0VqbmYyYTZTSUw1aWRVMFI3Q1pCTVRpTw/callback'
}
Command Handler file which is called on interactionCreate event:
McSimi.js
McSimi.js11mo ago
I defered the response. the rest of the message either doesnt help me or i dont understand it. maybe its because my server is to slow?