Responding to chooses

Hello how would you be able to respond differently depending which choose the user made using a stringoption for slash commands?
4 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Basgamer999
Basgamer999OP3y ago
*14.5.0 *value is a not definidied. *
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('faq')
.setDescription('Shows faq questions')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
)),
async execute(interaction) {
await interaction.reply(value);
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('faq')
.setDescription('Shows faq questions')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: '1', value: '1' },
{ name: '2', value: '2' },
{ name: '3', value: '3' },
)),
async execute(interaction) {
await interaction.reply(value);
},
};
*this was my idea but it isnt working. i thought maybe value showed me what it was Thx! I wasn’t able to find it on that discord.ja guide
d.js docs
d.js docs3y ago
guide Slash Commands: Parsing options read more
monbrey
monbrey3y ago
Might need to add something to that about choices
Want results from more Discord servers?
Add your server