DiscordAPIError Unknown Interaction

Error:
[ERROR] Encountered error on chat input command "leaderboard" at path "/insert/path/here/commands/leaderboard.ts" DiscordAPIError: Unknown interaction
at RequestHandler.execute (/insert/path/here/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (/insert/path/here/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async CommandInteraction.deferReply (/insert/path/here/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:61:5) {
method: 'post',
path: '/interactions/1056759382110634005/aW50ZXJhY3Rpb246MTA1Njc1OTM4MjExMDYzNDAwNTo0MmliU1VPQnZzNjhYeTF2MTBlSWdXWHlMYnYzcmNxMWZobENOdHpSNlhqUGsxazRDcFlOazdMUks2cXdtbW1qMHFVNEdxUndFc005eHdoRXVjNDJXZklJWkdWa2ZyY0t1c3kwSVdqTWo2b0g0S2pHbFQzNzR3dzFSaGFramRDSQ/callback',
code: 10062,
httpStatus: 404,
requestData: { json: { type: 5, data: [Object] }, files: [] }
}
[ERROR] Encountered error on chat input command "leaderboard" at path "/insert/path/here/commands/leaderboard.ts" DiscordAPIError: Unknown interaction
at RequestHandler.execute (/insert/path/here/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (/insert/path/here/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async CommandInteraction.deferReply (/insert/path/here/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:61:5) {
method: 'post',
path: '/interactions/1056759382110634005/aW50ZXJhY3Rpb246MTA1Njc1OTM4MjExMDYzNDAwNTo0MmliU1VPQnZzNjhYeTF2MTBlSWdXWHlMYnYzcmNxMWZobENOdHpSNlhqUGsxazRDcFlOazdMUks2cXdtbW1qMHFVNEdxUndFc005eHdoRXVjNDJXZklJWkdWa2ZyY0t1c3kwSVdqTWo2b0g0S2pHbFQzNzR3dzFSaGFramRDSQ/callback',
code: 10062,
httpStatus: 404,
requestData: { json: { type: 5, data: [Object] }, files: [] }
}
my code is very long so: https://sourceb.in/QoDce66r02
SourceBin
DiscordAPIError
Instantly share your code with the world.
6 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dubfib
dubfibOP2y ago
when I run the command it gives me the error DiscordAPIError: Unknown interaction at RequestHandler.execute discord.js version: v13.12.0 node version: v19.3.0
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dubfib
dubfibOP2y ago
alright, ill try maybe showing 35 placements instead of 50 and I'll tell you if it works
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dubfib
dubfibOP2y ago
thanks for helping, i added interaction.deferReply() when chatInputRun() function is ran and it works
public async chatInputRun(interaction: Command.ChatInputInteraction) {
const option = interaction.options.getString('type')

if (option === "guild") {
interaction.deferReply();
public async chatInputRun(interaction: Command.ChatInputInteraction) {
const option = interaction.options.getString('type')

if (option === "guild") {
interaction.deferReply();
I understand that I need to defer the reply earlier because parsing html could take more time than just 3 seconds
Want results from more Discord servers?
Add your server