What causes this to be seen as an unknown interaction?

im just trying to make a ping command
No description
9 Replies
d.js toolkit
d.js toolkit7mo 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! - Marked as resolved by OP
Dave Blunts
Dave BluntsOP7mo ago
14.15.2 djs
const msg = await interaction.reply({ content: 'Ping?', ephemeral: true});
console.log(msg);
//let latency = msg.createdTimestamp - interaction.createdTimestamp;
//console.log(latency);
const msg = await interaction.reply({ content: 'Ping?', ephemeral: true});
console.log(msg);
//let latency = msg.createdTimestamp - interaction.createdTimestamp;
//console.log(latency);
DiscordAPIError[10062]: Unknown interaction
at handleErrors (/root/projects/bots/zatbot/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:148:10)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at BurstHandler.runRequest (/root/projects/bots/zatbot/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:144:20)
at _REST.request (/root/projects/bots/zatbot/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/src/lib/REST.ts:210:20)
at async ChatInputCommandInteraction.deferReply (/root/projects/bots/zatbot/node_modules/.pnpm/[email protected]/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:71:5)
at Ready.Execute (/root/projects/bots/zatbot/src/events/application/InteractionCreate.ts:17:47)
Emitted 'error' event on ZatClient instance at:
at emitUnhandledRejectionOrErr (node:events:403:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: { type: 5, data: { flags: undefined } } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
DiscordAPIError[10062]: Unknown interaction
at handleErrors (/root/projects/bots/zatbot/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:148:10)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at BurstHandler.runRequest (/root/projects/bots/zatbot/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:144:20)
at _REST.request (/root/projects/bots/zatbot/node_modules/.pnpm/@[email protected]/node_modules/@discordjs/rest/src/lib/REST.ts:210:20)
at async ChatInputCommandInteraction.deferReply (/root/projects/bots/zatbot/node_modules/.pnpm/[email protected]/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:71:5)
at Ready.Execute (/root/projects/bots/zatbot/src/events/application/InteractionCreate.ts:17:47)
Emitted 'error' event on ZatClient instance at:
at emitUnhandledRejectionOrErr (node:events:403:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: { type: 5, data: { flags: undefined } } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
d.js docs
d.js docs7mo ago
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
Dave Blunts
Dave BluntsOP7mo ago
i defered the response in the interaction create event may this be the cause of the error?
chewie
chewie7mo ago
no The error is thrown AT the deferReply() So its already too late there
Dave Blunts
Dave BluntsOP7mo ago
seems to have the fixed the use
chewie
chewie7mo ago
Also if you defer you can't use .reply()
Dave Blunts
Dave BluntsOP7mo ago
No description
Dave Blunts
Dave BluntsOP7mo ago
ye i just remembered it should .editReply() if you defer now it works when i do this thanks for the help
Want results from more Discord servers?
Add your server