#Options is not working for me

5 messages · Page 1 of 1 (latest)

upper gulch
#

I'm trying to create a command that has options, but discord does not want to offer to fill them.

const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = {
  data: new SlashCommandBuilder()
    .setName('echo')
    .setDescription('Replies with your input!')
    .addStringOption(option =>
      option.setName('input')
        .setDescription('The input to echo back')
        .setRequired(true)
    ),
    async execute(interaction) {
      // Always null
      const answer = interaction.options.getString('echo')
      return interaction.reply({content: `Your input: ${answer}`, ephemeral: true})
    }
}

Wildly apologize if somewhere already asked this, because I could not find

shy raptor
#

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

shrewd ginkgo
#

sounds like you registered the command without options and didn't re-register them after adding options

upper gulch
#

oh, mb i get u, u mean i need to add options and here too, right?

#

this file deploys commands to discord