[英]Bot sends an empty message when I try to send a RichEmbed
I'm trying to make a discord bot on discord.js. 我正在尝试在discord.js上创建一个discord机器人。 I'm having some trouble with RichEmbed.
我在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: 结果是这样的:
Console logs contain the embed requested, but it is not in the message it sends. 控制台日志包含请求的嵌入,但不在其发送的消息中。
What I'm missing? 我想念的是什么?
UPD UPD
Every RichEmbed I try to send is empty. 我尝试发送的每个RichEmbed都是空的。 Could it be that my guild requires additional setup?
公会需要其他设置吗?
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.
因此,请选择:预览所有链接或禁用嵌入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.