Alternative Slash Command Option

Here is a slash command I am creating to kick a user. I want the user of the command to be able to alternate between the options and decide weather they want to enter a username or an ID. It has to be required of course, but by the way I have created it, both need to be entered. How do I do if I want one to not be required if the other already has been entered?
No description
6 Replies
d.js toolkit
d.js toolkit6mo 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!
AzcenD
AzcenDOP6mo ago
The reason I am doing it this way is that the user that the admin wants to kick might have strange symbols or a font in their name. I guess that the admin can copy the username, but this will also teach me how to have several alternatives while just one of them needs to be required.
NyR
NyR6mo ago
Remove the Integer option, User option also accepts IDs You can't dynamically require an option
AzcenD
AzcenDOP6mo ago
ok thanks
Amgelo
Amgelo6mo ago
while you should do what NyR mentioned for this case, in general if you'd want that you could make a subcommand each subcommand can have their own options (and you can only execute one subcommand at a time)
d.js docs
d.js docs6mo ago
:guide: Slash Commands: Advanced command creation - Subcommands read more
Want results from more Discord servers?
Add your server