#Slash Commands

15 messages · Page 1 of 1 (latest)

oblique turtle
#

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

frail viper
#

const data = new SlashCommandBuilder()
    .setName('set')
    .setDescription('Seta o status do seu dino.')
    .addStringOption(option =>
        option.setName(':Health: Health')
            .setDescription('Define o HP do seu dino.'));
    .addStringOption(option =>
        option.setName(':Stamina: Stamina')
            .setDescription('Define a Stamina do seu dino.'));
    .addStringOption(option =>
        option.setName(':Melee: Melee')
            .setDescription('Define o Melee do seu dino.'));
#

for example

#

Health : 0

#

i want to !set Health 10 and make Health : 10

#

how can i proceed

#

im new to coding in js btw

sterile onyx
#

Just curious, if these options are to return a number why don’t you use the integer option?

#

I don’t really understand your question, if you want to set the Health option to 10 you resolve the option.

interaction.options.getString('name_here')
#

Then add it to whatever else

frail viper
sterile onyx
#

Okay, I still don’t really understand but so sent how you get the value for your string(s)

frail viper
sterile onyx
#

That’s up to you to decide

frail viper