I'm remaking a Discord music bot I made a while back in Discord.js v12.5.3
and when I try and use any slash command except play it gives me this 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.status); ^
DiscordAPIError: 404: Not Found at RequestHandler.execute (C:\Users\Alex\Documents\Programming\NodeJS\Discord bots\DJeff New\node_modules\discord.js\src\rest\RequestHandler.js:154:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\Alex\Documents\Programming\NodeJS\Discord bots\DJeff New\node_modules\discord.js\src\rest\RequestHandler.js:39:14) { method: 'post', path: '/interactions/callback', code: 0, httpStatus: 404 }
Here is how I pass the arguments and other stuff:
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 || []);
And here's my skip.js file for reference:
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."
);
},
};