Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

417
Views
How do I query the content of the addStringOption in the interactions in discord v13?

Good day,

I would like to save the content that you type in addStringOption, I just don't know how to query that, can someone explain it to me?

   const { SlashCommandBuilder } = require("@discordjs/builders");
    
    module.exports = {
        data: new SlashCommandBuilder()
        .setName('announce')
        .setDescription('test')
        .addSubcommand(subcommand =>subcommand.setName('normal').setDescription('TEST')
        .addStringOption(option => option.setName('message').setDescription('TEST').setRequired(true))),
    
        async execute(interaction) {
            interaction.reply("test")
        }
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I am not 100% what you mean by query but I assume you want to get the value of the option they user has entered. For this you want to use the getString function on the options property.

async execute(interaction) {
  // Get the string option
  const value = interaction.options.getString('message');
  // Return the value
  await interaction.reply(value);
}

Read More Here: https://discord.js.org/#/docs/discord.js/stable/class/CommandInteractionOptionResolver?scrollTo=getString

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!