Generating embeds but size exceed 6000

Hey, i've got an array of fields and i'm generating an array of embeds that i send like this :
const embeds = [];
while (fields.length)
embeds.push(
new EmbedBuilder()
.setColor(Colors.Blue.int)
.addFields(fields.splice(0, 20))
);

embeds[0]
.setTitle("Commande chargée")
.setThumbnail("https://img.icons8.com/fluency/48/cookie.png");

i.editReply({ embeds });
const embeds = [];
while (fields.length)
embeds.push(
new EmbedBuilder()
.setColor(Colors.Blue.int)
.addFields(fields.splice(0, 20))
);

embeds[0]
.setTitle("Commande chargée")
.setThumbnail("https://img.icons8.com/fluency/48/cookie.png");

i.editReply({ embeds });
but i've got this error embed size exceed 6000. thx for ur help !
5 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
d.js docs
d.js docs5mo ago
Learn more about embed limits at the Discord Developer Documentation
Gykas
GykasOP5mo ago
i know that but is there a way to calculate the length of the embed ? And is it linked to the number of embeds sent in the same message ?
d.js docs
d.js docs5mo ago
:property: EmbedBuilder#length @14.15.3 The accumulated length for the embed title, description, fields, footer text, and author name.
Gykas
GykasOP5mo ago
okay thx !
Want results from more Discord servers?
Add your server