unknown interaction error
Is there a reason why I keep getting random unknown interaction errors?
[2023-04-04 00:16:12] [ERROR] Encountered error on chat input command "translate" at path "/workspace/src/commands/basic/translate.js" DiscordAPIError: Unknown interaction
[biit] [2023-04-04 00:16:12] at RequestHandler.execute (/workspace/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
[biit] [2023-04-04 00:16:12] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[biit] [2023-04-04 00:16:12] at async RequestHandler.push (/workspace/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
[biit] [2023-04-04 00:16:12] at async CommandInteraction.reply (/workspace/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:103:5)
[biit] [2023-04-04 00:16:12] at async TranslateCommand.chatInputRun (/workspace/src/commands/basic/translate.js:59:12)
[biit] [2023-04-04 00:16:12] at async /workspace/node_modules/@sapphire/framework/dist/listeners/application-commands/chat-input/CoreChatInputCommandAccepted.js:17:28
[biit] [2023-04-04 00:16:12] at async Object.fromAsync (/workspace/node_modules/@sapphire/result/dist/index.js:615:22)
[biit] [2023-04-04 00:16:12] at async CoreListener.run (/workspace/node_modules/@sapphire/framework/dist/listeners/application-commands/chat-input/CoreChatInputCommandAccepted.js:14:24)
[biit] [2023-04-04 00:16:12] at async Object.fromAsync (/workspace/node_modules/@sapphire/result/dist/index.js:615:22)
[biit] [2023-04-04 00:16:12] at async CoreListener._run (/workspace/node_modules/@sapphire/framework/dist/lib/structures/Listener.js:93:24) {
[biit] [2023-04-04 00:16:12] method: 'post',
[biit] [2023-04-04 00:16:12] path: '/interactions/1092603447557234769/aW50ZXJhY3Rpb246MTA5MjYwMzQ0NzU1NzIzNDc2OTpxa1pITUFVcEFuNm03ZFhpZmZNS3lOR0RxUUZaZGdmZmVHVXU0U05KRzZiWVhoazRDUWlNRkdOeDhSRFFTRlNVa24zT3RJY0szeWt1Vml1TzhKRnI4anQ3TjE1UGp2N2ZCblkwSWF0UmlBSXlTNzFjM041cUZvRzlRVTBiZFV1Sw/callback',
[biit] [2023-04-04 00:16:12] code: 10062,
[biit] [2023-04-04 00:16:12] httpStatus: 404,
[biit] [2023-04-04 00:16:12] requestData: { json: { type: 4, data: [Object] }, files: [] }
[biit] [2023-04-04 00:16:12] }
Solution:Jump to solution
Then add interaction.deferReply() before the async function and then reply with interaction.editReply();
Normal commands only can respond in 3 seconds and with deferred 15 minutes...
7 Replies
the command works sometimes, but other times it throws this error
I imagine that the command is async, right?
yes
async chatInputRun(interaction){}
when i tested the bot running locally it seems to function fine, but once i pushed to the hosting it is having some issues
Solution
Then add interaction.deferReply() before the async function and then reply with interaction.editReply();
Normal commands only can respond in 3 seconds and with deferred 15 minutes
okay i will try that rq
Had the same issue. I accidentally still had the bot running in an old terminal, which lead to one of the instances respond to the command just fine and the other one responding to an already finished command.
last night i encountered an even weirder problem. the bot has been running just fine, then suddenly all the commands were deregistered and i had to reboot the bot to fix it