Slash Command Builder Default Option Values
Good morning all!
[email protected]
node v18.12.0
I'm working w/ SlashCommandBuilder
and am trying to figure out how to set a default value for an option (e.g. String, Boolean, etc.) in the event the user doesn't provide a value
For example,
I would want to use something like .setDefault(true)
so if the user didn't give anything I could use private
to do something like
Where it posts an ephemeral post by default unless the user explicitly sets private
to false
I've also tried logging the value of private
with and without user input to see if I can bootleg my way around it but always get null
for some reason...
Any help would be appreciated! Thanks!3 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!
- ✅
Marked as resolved by OPYou can just do something like this:
This is perfect, can't believe I didn't think of it. Thanks @Danial 👻 !