Mi bot estaba funcionando completamente bien. Y luego, de repente, comencé a recibir el error de Interacción desconocida.
DiscordAPIError: Unknown interaction at RequestHandler.execute (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/rest/RequestHandler.js:350:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/rest/RequestHandler.js:51:14) at async CommandInteraction.reply (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:99:5) { method: 'post', path: Path here yk, code: 10062, httpStatus: 404, requestData: { json: { type: 4, data: { content: 'POING', tts: false, nonce: undefined, embeds: undefined, components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined } }, files: [] } }Este comando ping es solo un ejemplo, recibo este error en casi todos los comandos de interacción que escribo en Discord. He estado buscando el problema durante mucho tiempo, pero todavía no pude encontrar nada.
Este es el comando ping:
const { CommandInteraction } = require("discord.js"); module.exports = { name: "ping", description: "Ping", permission: "ADMINISTRATOR", /** * * @param {CommandInteraction} interaction */ execute(interaction) { interaction.reply({content: "POING"}) } }Es solo un comando básico que hice para probar si el problema está en los comandos en sí o en otro lugar. Parece que está en otro lugar.
Este es mi evento de creación de interacción:
const { Client, CommandInteraction, MessageEmbed } = require("discord.js"); module.exports = { name: "interactionCreate", /** * * @param {CommandInteraction} interaction * @param {Client} client */ async execute(interaction, client){ if(interaction.isCommand() || interaction.isContextMenu()){ const command = client.commands.get(interaction.commandName); if(!command) return interaction.reply({embeds : [ new MessageEmbed() .setColor("RED") .setDescription("⛔ An error occurred while running this command.") ]}) && client.commands.delete(interaction.commandName); command.execute(interaction, client); } } }