brian-gates / adventure-bot

Find Adventure Bot at it's new home: https://github.com/Adventure-Bot/adventure-bot
https://github.com/Adventure-Bot/adventure-bot
4 stars 0 forks source link

Unknown interaction #51

Closed brian-gates closed 2 years ago

brian-gates commented 2 years ago
Full Stack ``` E:\adventure-bot\adventure-bot\node_modules\discord.js\src\rest\RequestHandler.js:349 throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Unknown interaction at RequestHandler.execute (E:\adventure-bot\adventure-bot\node_modules\discord.js\src\rest\RequestHandler.js:349:13) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (E:\adventure-bot\adventure-bot\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async CommandInteraction.reply (E:\adventure-bot\adventure-bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:98:5) { method: 'post', path: '/interactions/915682712537415680/aW50ZXJhY3Rpb246OTE1NjgyNzEyNTM3NDE1NjgwOks2eG9qaHgwVWpFOXlnTGJuOGZNSWoxWEdNdE9Kbzc3MGdUMnVLMnJjYmtMbWJtaEtyV1kyYU9iNHIzaW9aYmtuOGMyb3lvWXZabGFTR0lwQ2FLWk9OclpkN3hEbkp2TXJVZUZVa09uY2VkRU1CYUVYekt1aGY1U3VGdHUySlNL/callback', code: 10062, httpStatus: 404, requestData: { json: { type: 4, data: { content: undefined, tts: false, nonce: undefined, embeds: [ { title: 'JenGat encounters a Shrine of Agression', type: 'rich', description: 'This shrine fills you with a rage!', url: null, timestamp: 0, color: 15548997, fields: [], thumbnail: null, image: [Object], author: null, footer: null }, { title: 'Shrine of Agression', type: 'rich', description: null, url: null, timestamp: 2021-12-01T19:46:11.000Z, color: null, fields: [Array], thumbnail: null, image: null, author: null, footer: null } ], components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined } }, files: [] } } error Command failed with exit code 1. ```

When you are using the slash commands you have 3 seconds to response.

https://stackoverflow.com/a/68774492/786729

A solution might be to create an empty response immediately, then have the command handlers edit it once they're finished.

https://github.com/brian-gates/adventure-bot/blob/main/src/index.ts#L65