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

224
Vistas
Throwing an error when trying to send a embed

I'm trying to create an embed using discord.js v12 and it keeps showing this error

DiscordAPIError: Cannot send an empty message

Heres my code:

        const infoembed = new MessageEmbed()
            .setColor('#0099ff')
            .setTitle(responce.asset.title)
            
        umsg.channel.send({ embeds: infoembed });
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

If you're on discord.js v13 you have to put your embed in an array:

const infoembed = new MessageEmbed()
            .setColor('#0099ff')
            .setTitle(responce.asset.title)
            
umsg.channel.send({ embeds: [infoembed] });

And if you want to add some text content to the message you simply have to add the field content:

const infoembed = new MessageEmbed()
            .setColor('#0099ff')
            .setTitle(responce.asset.title)
            
umsg.channel.send({ content: 'Hello world!', embeds: [infoembed] });

Since you're using discord.js v12, you have to remove the curly brackets and the embeds field:

const infoembed = new MessageEmbed()
            .setColor('#0099ff')
            .setTitle(responce.asset.title)
            
umsg.channel.send(infoembed);
about 4 years ago · Juan Pablo Isaza Denunciar

0

All messages sent by bots now support up to 10 embeds. As a result, the embed option was removed and replaced with an embeds array, which must be in the options object.

umsg.channel.send({ embeds: [infoembed] });

Read documentation

about 4 years ago · Juan Pablo Isaza Denunciar

0

If responce.asset.title is empty - you will get an error because discord can't send embed with empty title! But you can try using this code:

const infoembed = new MessageEmbed()
      .setColor('#0099ff')
      .setTitle(`** **`);

umsg.channel.send(infoembed)
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