Estoy rehaciendo un bot de música Discord que hice hace un tiempo en Discord.js v12.5.3
y cuando trato de usar cualquier comando de barra excepto reproducir, me da este error:
C:\Users\Alex\Documents\Programming\NodeJS\Discord bots\DJeff New\node_modules\discord.js\src\rest\RequestHandler.js:154 throw new DiscordAPIError(request.path, data, request.method, res. estado); ^
DiscordAPIError: 404: no encontrado en RequestHandler.execute (C:\Users\Alex\Documents\Programming\NodeJS\Discord bots\DJeff New\node_modules\discord.js\src\rest\RequestHandler.js:154:13) en processTicksAndRejections (node:internal/process/task_queues:96:5) en async RequestHandler.push (C:\Users\Alex\Documents\Programming\NodeJS\Discord bots\DJeff New\node_modules\discord.js\src\rest\RequestHandler. js:39:14) { método: 'publicar', ruta: '/interacciones/devolución de llamada', código: 0, httpStatus: 404 }
Así es como paso los argumentos y otras cosas:
interaction.reply = (client, response) => { client.api.interactions(this.id, this.token).callback.post({ data: { type: 4, data: { content: response, }, }, }); }; command.execute(client, interaction, interaction.data.options || []);
Y aquí está mi archivo skip.js como referencia:
module.exports = { name: "skip", usage: null, options: null, async execute(client, interaction, args) { var serverQueue = client.queue.get(interaction.guild_id); const guild = await client.guilds.fetch(interaction.guild_id); const userVoiceChannel = guild.members.cache.get( interaction.member.user.id ).voice.channel; if (!userVoiceChannel) return interaction.reply( client, "You need to be in a voice channel to use this command." ); var clientVoiceChannel = client.voice.connections.get( interaction.guild_id ); if (!clientVoiceChannel) return interaction.reply( client, "I need to be in a voice channel to execute this command." ); if ( clientVoiceChannel.channel.id !== guild.members.cache.get(interaction.member.user.id).voice.channel.id ) return interaction.reply( client, "You need to be in the same voice channel as me to use this command." ); if (!serverQueue) return interaction.reply(client, "Nothing is playing."); serverQueue.connection.dispatcher.end("Skipped the current video."); return interaction.reply( client, ":fast_forward: **|** Skipped the current video." ); }, };