#Option based on the Choice [SlashCommands]

3 messages · Page 1 of 1 (latest)

cunning oak
#

Is it possible that the "side" option only appears for the user if he chooses the "Coinflip" choice? Like if he chooses the slots choice the side option is not avaible

    new SlashCommandBuilder().setName('gamble').setDescription('Gamble with your money')
    .addStringOption(option =>
      option.setName('game')
        .setDescription('Choose a game to play')
        .setRequired(true)
        .addChoices(
          { name: 'Slots', value: 'slots' },
          { name: 'Coinflip', value: 'coinflip' }
        ))
        .addIntegerOption(option =>
          option.setName('coins')
          .setDescription('How many coins you want to play with')
          .setRequired(true)
        .addStringOption(option =>
          option.setName('side')
            .setDescription('The side you want to bet on.')
            .addChoice('Heads', 'heads')
            .addChoice('Tails', 'tails')
            .setRequired(true)),

Or could anyone find a different method how I can do this whole gamble section without spamming my commands with all games

trim salmonBOT
#

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

cunning oak