所以我想说我创建了一个嵌入并将其发送到一个频道。这是嵌入:
const embed = new Discord.RichEmbed()
.setColor(color)
.setTitle(`${message.author.tag} wants to play.`)
.setAuthor(message.author.tag, message.author.displayAvatarURL)
.setDescription(game)
.setThumbnail(icon)
.addField(`\u200b\n**React with ${emoji} to join.**`, "Remove your reaction to leave.");
一旦发送,我想编辑嵌入的标题和描述,并删除我在最后添加的字段。
这是我正在尝试创建的新嵌入:
const embed = new Discord.RichEmbed(reaction.message.embeds[0])
.setTitle("This game has ended.")
.setDescription("You can no longer join.");
这会更改标题和说明,但我不确定如何删除我添加的字段。
对不起,我误会了。您可以手动将属性设置为新嵌入对象的embed.fields,
为null。 here是RichEmbed属性的文档。
在您的特定情况下,要删除您可能执行的所有字段:
embed.fields = null;