65454
65454

Reputation: 15

embeds[0].description: This field is required

I am using the lastest version of discord.js v13 and the latest version of node and every single package. I am getting the following error and here is the code. Please help.

Error

embeds[0].description: This field is required

Code

    const exampleEmbed =
        ({
            embeds: [new MessageEmbed()
                .setColor('#1a038a')
                .setTitle('Proxy')
                .setDescription('Proxy Help Embed')
                .addFields(
                    { name: 'Bot', value: '`ping`, `invite`', inline: false },
                )
                .setTimestamp()
                .setFooter('TEST')
                .setImage('IMAGE')
                .setURL('URL')]
        })
    return message.channel.send({ embeds: [exampleEmbed] });

}

Here is the full error of this code

enter image description here

Upvotes: 1

Views: 1908

Answers (1)

Finbar
Finbar

Reputation: 1353

The exampleEmbed variable is an object with the property embeds which is an array, therefore you must do:

return message.channel.send({ embeds: [exampleEmbed.embeds[0]] });

To access the first item in the embeds property of the exampleEmbed variable.

The error:

embeds[0].description: This field is required

Says that the first embed of the embeds array in the MessagePayload doesn't have a description, hinting the requested location in the exampleEmbed variable doesn't exist.

Upvotes: 1

Related Questions