krege
krege

Reputation: 23

Bot sends an empty message when I try to send a RichEmbed

I'm trying to make a discord bot on discord.js. I'm having some trouble with RichEmbed. Here is the code:

if (command === "q") {
  const messageID = args[0];
  console.log("MSG id " + messageID);
  message.channel.fetchMessage(messageID).then(messagea => {
    const reportEmbed = new Discord.RichEmbed()
      .setTitle("Reports")
      .setColor("#F7E533")
      .addField("Message", messagea.content)
      .addField("Reported User", `@${messagea.author}`)
      .addField("Reported By", `${message.author} with ID: ${message.author.id}`)
      .addField("Time", message.createdAt);

    message.channel.send({
      embed: reportEmbed
    });
    console.log(reportEmbed);
    return;
  })
}

The result is this:

The bot sends an empty message

Console logs contain the embed requested, but it is not in the message it sends.
What I'm missing?

UPD
Every RichEmbed I try to send is empty. Could it be that my guild requires additional setup?

Upvotes: 0

Views: 1189

Answers (1)

krege
krege

Reputation: 23

The issue was in account preferences: discord require links preview to be enabled to show the embed. So choose: preview all links or disable embed.

Upvotes: 1

Related Questions