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 User2y ago
Message Not Public
Sign In & Join Server To View
Basgamer999
Basgamer9992y 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 docs2y ago
guide Slash Commands: Parsing options read more
monbrey
monbrey2y ago
Might need to add something to that about choices
Want results from more Discord servers?
Add your server
More Posts
I have this delete-commands.js for slash commands and it isn't working.https://gist.github.com/DudeThatsErin/b0231f2a38cb85309a33de14faac0107 This is the error message I Expecting a string primitive for SlashCommandBuilderI tried making an embed command using Slash commands and a lot of paramaters(probably not a good idewhen his bot is inside a voice channel, moving others takes about 5 seconds, whilst when it’s not inthere is a very strange bug when my bot is in vocal and that it has to move a member the action but How can I get the voice states of members?How can I get the voice states of members? For some reason do I only get the voice states of the memAdding a role to owner of a server.Hello, I've searched the Internet for this answer but did not find it, so here I am. I wanted to knHow to see which option was triggered from an interactionI have a slash command where there are two options (say a and b). a has three choices say 1,2,3 b haSending files from vue front end to custom discord bot through express backend.I'm wondering what the best process to doing this is. Currently I have a vue frontend component whicIs it possible for a bot so send a message before it goes offline?I am just wondering, can I make it so my bot sends a "Going Offline" message right before it becomesMismatched parameters and command handler not to optimized.Hi devs, im triying to fix my mismatched parameters and maybe the handler its the problem!How do I get target messageHow do I check if message is a reply and get the target message?