How to use the .addChoices command

.addStringOption(option =>
option.setName('game')
.setDescription('game')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
{ name: '4', value: '4' }
)),
.addStringOption(option =>
option.setName('game')
.setDescription('game')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
{ name: '4', value: '4' }
)),
How do I write a code that uses number 1 based on the code above?
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
d.js docs
d.js docs2y ago
Suggestion for @박준서:guide Slash Commands: Command options - Choices read more
Want results from more Discord servers?
Add your server