Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!