module.exports.data = new SlashCommandBuilder()
.setName("ping")
.setDescription("Ping the user")
.addUserOption((option) => option.setName('user').setDescription('The user to boop').setRequired(true));
module.exports.run = (bot, interaction) => {
interaction.editReply ({
content: "Pong"
})
}
``` Having some trouble would appreciate the help
#Adding options inside a SlashCommandBuilder
1 messages · Page 1 of 1 (latest)
did you redeploy the commands?
how are you setting the commands
ok, show that
thats not it, that's receiving the interactions and executing the command
yes, thats it
alright
did you run that?
pretty sure it runs automatically
you need to run that everytime you update a commands options
and also, since you're using global commands, they might take up to an hour to update
oh dang
where should i put it then
you need to close the try block, add a catch block, and then close the IIFE
(async () => {
try {
// stuff
} catch (error) {
// error happened
}
})();
yep
did those console.logs log anything
thats an issue on your end then, not something related to discord.js
dont know what i should do cuz i got no idea
add more console.log()s 😁
so basically debugging whole slash-register?
sure
and what's updateCommands?
and where are you executing that function
search for the file path, you must be using require() with it on some other file
theres no require for the updateCommands
is that the name of the file?
the things its suppose to require is the updateCommands right?
no, thats the name of the parameter
so what needs to be required
the file path
slash-register?
if that's the file name, yes
that () is executing the function, and you're not passing anything to it
oh right
which means the updateCommands parameter will be undefined
no, add true
alright
works
so um now theres 2 commands
1 with user argument and 1 without
yeah, the one without is the global command
oh so can i remove it somehow?
the up to date one is the guild command
client.application.commands.set([])
however, as i said previously, it might take up to an hour to update
alright so if i add bot to another server the global one will be gone?