Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

564
Visualizações
Discord.js DiscordAPIError: Invalid Form Body issue

I have a Discord bot and there is a problem with the command named privacy policy in this bot, I asked a lot of people and they said they don't know.

Node.js version: 16.13.2 Discord.js version: 13.6.0

MAİN

client.commands = new Collection();

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
const eventFiles = fs.readdirSync('./events').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command);
}

COMMAND

module.exports = {
    name: 'gizlilik',
    description: 'gizlilik politikası',
    execute(message, args) {
    const Discord = require("discord.js")
    const gizlilik = new Discord.MessageEmbed()
    .setTitle("Hextro Gizlilik Politikası")
    .setDescription("Gizlilik Politikasına aşağıdaki butondan ulaşabilirsiniz.")
    .setColor("RANDOM")

    const buton = new Discord.MessageButton()
    .setLabel("Politika")
    .setStyle("url")
    .setURL("https://github.com/Husum0/Hextro-Gizlilik-Politikasi/blob/main/gizlilik.md");
    let row = new Discord.MessageActionRow()
    .addComponents(buton)
  
  message.channel.send({ content: 'Pong!', embeds: [gizlilik], components: [row] });
    },
};

ERROR

Unhandled promise rejection: DiscordAPIError: Invalid Form Body components[0].components[0].style: This field is required at RequestHandler.execute (C:\Users\Administrator\Desktop\hexiye\node_modules\discord.js\src\rest\RequestHandler.js:350:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\Administrator\Desktop\hexiye\node_modules\discord.js\src\rest\RequestHandler.js:51:14) at async TextChannel.send (C:\Users\Administrator\Desktop\hexiye\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:175:15) { method: 'post', path: '/channels/931267478292680769/messages', code: 50035, httpStatus: 400, requestData: { json: { content: 'Pong!', tts: false, nonce: undefined, embeds: [Array], components: [Array], username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined }, files: [] } }

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

url is not a valid style to set your embed to, instead, it should be LINK - see discord.js documentation here.

your command should end up looking like this:

module.exports = {
    name: 'gizlilik',
    description: 'gizlilik politikası',
    execute(message, args) {
        const Discord = require('discord.js');
        const gizlilik = new Discord.MessageEmbed()
            .setTitle('Hextro Gizlilik Politikası')
            .setDescription('Gizlilik Politikasına aşağıdaki butondan ulaşabilirsiniz.')
            .setColor('RANDOM');

        const buton = new Discord.MessageButton()
            .setLabel('Politika')
            .setStyle('LINK')
            .setURL('https://github.com/Husum0/Hextro-Gizlilik-Politikasi/blob/main/gizlilik.md');
        let row = new Discord.MessageActionRow().addComponents(buton);

        message.channel.send({ content: 'Pong!', embeds: [gizlilik], components: [row] });
    }
};
about 4 years ago · Juan Pablo Isaza Relatório

0

For when it says you have invalid for of body ,,, all that means is to update your app Go to you appstore look for discord and update the app!

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda