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

198
Views
Error 50035 in Slash Command | Discord.js

DiscordAPIError[50035]: Invalid Form Body 0.options[0].type[NUMBER_TYPE_COERCE]: Value "STRING" is not int.

This happens out of nowhere

    const Command = require('../../structures/Command') //../ Sinaliza quantas pastas pular

    const { MessageEmbed } = require('discord.js')

    module.exports = class extends Command {
        constructor(client) {
           super(client, {
              name: 'wildcat',
              description: 'Insira o código do Bundle indicado.',
              options:[
                {
                    name: 'codigowildcat' ,
                    type: 'STRING' ,
                    description: 'Código do bundle.' ,
                    required: true
                }
              ]
           })
        }

        run = (interaction) => {

            const wildcat = interaction.options.getString('codigowildcat')

            let apostos = "```"

            const embed = new MessageEmbed()
                //.setTitle(`Seu código.`)
                .setThumbnail("https://cdn.discordapp.com/attachments/694959159199793236/987371688444428309/Wildcat.png")
                .setDescription(`<:confetes:985241046197882950>** ・__ Parabéns, você acabou de comprar: <:Wildcat:910010235505233981> WILDCAT!__**

                **Segue abaixo o seu \`CÓDIGO\` exclusivo:**

                ${apostos}${wildcat}${apostos}
                :100:  | Lembre-se de deixar uma PRINT em <#909845324858798131> para nos ajudar.`)
                .setColor('#0eb2ee')
                .setFooter('💙 ・ TB STORE Agradece a preferência e confiança.')
                //.setTimestamp()

                return interaction.reply({ embeds: [embed] })
               .catch(() => interaction.reply({content: `Erro | Erro ao tentar enviar a mensagem.`, ephemeral: true }))

        }
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You didn't provide much context, but you can create a slash command looking for an integer input like this

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


/** Defining a command */
let command = new SlashCommandBuilder()
  .setName('command name')
  .setDescription('command description')
  .addIntegerOption(option =>
  option.setName('optionName')
    .setDescription('option description')
    .setRequired(true))


/** Handling the interaction */
client.on('interactionCreate', interaction => {
  if (!interaction.isCommand()) return;

  let input = interaction.options.getInteger('optionName');

  /** Rest of code */
})
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!