当我尝试发送RichEmbed时,Bot发送一条空消息

问题描述 投票:0回答:1

我正在尝试在discord.js上制作一个discord bot。我在使用RichEmbed时遇到了一些麻烦。这是代码:

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;
  })
}

结果是这样的:

控制台日志包含所请求的嵌入,但它不在它发送的消息中。 什么我失踪?

UPD 我尝试发送的每个RichEmbed都是空的。可能是我的公会需要额外的设置吗?

node.js discord discord.js
1个回答
1
投票

问题出在帐户首选项中:discord需要启用链接预览才能显示嵌入。因此,选择:预览所有链接或禁用嵌入。

© www.soinside.com 2019 - 2024. All rights reserved.