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

146
Vistas
Getting 'DiscordAPIError: Invalid Form Body' when trying to send an embed

When someone tries to show the queue of a really big playlist, the bot crashes with the error: DiscordAPIError: Invalid Form Body data.embeds[0].description: Must be 4096 or fewer in length.

This is the code that shows the queue:

case "queue" : 
    return interaction.reply({embeds: [new MessageEmbed()
        .setColor("PURPLE")
        .setDescription(`${queue.songs.map(
            (song, id) => `\n**${id + 1}**. ${song.name} - \`${song.formattedDuration}\`` )}`
    )]});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Its exactly what the error says. Discord embed limitations: (https://discord.com/developers/docs/resources/channel#embed-limits)

Ur embed description must have less then 4096 characters. You can just use a function to trim the description

function shorten(str) {
  if (str.length > 1000) {
      return str.substring(0, 1001) + '...';
  } else {
      return str;
  }
}

You could optionally make pages in your embed that divides ur queue into two parts and shows the second list when reacting

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