#slash command add choices

4 messages · Page 1 of 1 (latest)

proven solstice
#
.addStringOption(option =>
            option.setName('Name')
                .setDescription('Descreption')
                .setRequired(true)
                .addChoices())

Im having a problem with .addChoices()
Previous version I used .addChoice('displayName', 'id') multiple times but that function seems to not exist any longer
What arguments does .addChoices() take? The docs say

...Array <APIApplicationCommandOptionChoice<string >>
but Im not familiar enough to understand what that means

north pierBOT
#

• 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.

little frigate
#

addChoices({name: …, value: …}, {…}, …)

proven solstice