BrickInYourFace
BrickInYourFace
DIAdiscord.js - Imagine an app
Created by BrickInYourFace on 4/24/2024 in #djs-questions
How to get values from options other than .getString()?
ah, thank you.
10 replies
DIAdiscord.js - Imagine an app
Created by BrickInYourFace on 4/24/2024 in #djs-questions
How to get values from options other than .getString()?
when the value is received, i can use it in my execute function
10 replies
DIAdiscord.js - Imagine an app
Created by BrickInYourFace on 4/24/2024 in #djs-questions
How to get values from options other than .getString()?
so as im trying to understand. choices return a value that can be used in a particular way
10 replies
DIAdiscord.js - Imagine an app
Created by BrickInYourFace on 4/24/2024 in #djs-questions
How to get values from options other than .getString()?
const {SlashCommandBuilder} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName('gifbot')
.setDescription('Sends a random gif!')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: 'Funny', value: 'gif_funny' },
{ name: 'Meme', value: 'gif_meme' },
{ name: 'Movie', value: 'gif_movie' },
)
),
async execute(interaction) {
const values = interaction.options.getString("values");
await interaction.reply(`/gif ${values}`);
}
}
const {SlashCommandBuilder} = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName('gifbot')
.setDescription('Sends a random gif!')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: 'Funny', value: 'gif_funny' },
{ name: 'Meme', value: 'gif_meme' },
{ name: 'Movie', value: 'gif_movie' },
)
),
async execute(interaction) {
const values = interaction.options.getString("values");
await interaction.reply(`/gif ${values}`);
}
}
10 replies
DIAdiscord.js - Imagine an app
Created by BrickInYourFace on 4/24/2024 in #djs-questions
How to get values from options other than .getString()?
i dont have any code in particular (i took the one in the guide for testing purposes)
10 replies
DIAdiscord.js - Imagine an app
Created by BrickInYourFace on 4/24/2024 in #djs-questions
How to get values from options other than .getString()?
thank you, so does this include the values returned from choices too?
10 replies