DiscordAPIError: Cannot send an empty message (discord.js v1



我正在尝试获取在通道中发送的消息的message.content。当消息发送时,我得到一个错误:

DiscordAPIError: Cannot send an empty message

代码:

client.on("message", (message) => {
if (message.channel.id === "CHANNELID") {
const embed = new MessageEmbed()
.setDescription(message.content)
.setColor("#E74C3C")
.setTimestamp()
.setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true }))
message.client.channels.cache.get(CHANNELID).send(embed);
}

change your send…

message.client.channels.cache.get(CHANNELID).send(embed);

message.client.channels.cache.get(CHANNELID).send({embed});

相关内容

  • 没有找到相关文章

最新更新