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?
6 Replies
- 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!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.
Remove the Integer option, User option also accepts IDs
You can't dynamically require an option
ok
thanks
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)