Subcommands

Hey i have 3 slash commands, setup, setup_image, setup_video, i tried making the setup_image into "setup image" and it worked but the setup command stopped showing. How can i do it while keeping the setup command there?
9 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Lawa
LawaOP8mo ago
setup image file, setupImage.js
data: new SlashCommandBuilder()
.setName('setup')
.setDescription('Setup commands')
.addSubcommand((subcommand) =>
subcommand
.setName('image')
.setDescription("in a specific channel")
.addChannelOption((option) =>
option
.setName("channel")
.setDescription("Image channel")
.setRequired(true)
.addChannelTypes(0)
)
),
data: new SlashCommandBuilder()
.setName('setup')
.setDescription('Setup commands')
.addSubcommand((subcommand) =>
subcommand
.setName('image')
.setDescription("in a specific channel")
.addChannelOption((option) =>
option
.setName("channel")
.setDescription("Image channel")
.setRequired(true)
.addChannelTypes(0)
)
),
normal setup file, setup.js
data: new SlashCommandBuilder()
.setName("setup")
.setDescription("Setup channels")
),
data: new SlashCommandBuilder()
.setName("setup")
.setDescription("Setup channels")
),
slash command showing up is only "setup image"
NyR
NyR8mo ago
The base command is not available if you use subcommands/subcommands group, you can either have one of the two @Lawa
Using subcommands or subcommand groups will make your base command unusable. You can't send the base /permissions command as a valid command if you also have /permissions add | remove as subcommands or subcommand groups
d.js docs
d.js docs8mo ago
:discord: Application Commands - Subcommands and Subcommand Groups read more
Lawa
LawaOP8mo ago
so how can i have commands like: setup setup image a lot of bots have it
NyR
NyR8mo ago
Did you just not read the above? It's not possible! And i doubt any bot has it, you can maybe register the setup one as guild command (since guild and global commands are different) that's the only way you can have both, but guild commands will only be available in the guild it is registered to
Lawa
LawaOP8mo ago
i read the above and it is possible since i've seen it
NyR
NyR8mo ago
So you're saying that discord themselves are lying? I doubt
Lawa
LawaOP8mo ago
well alright thanks for the help
Want results from more Discord servers?
Add your server