Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

556
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda