Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda