Remove/delete 从消息中嵌入

Remove/delete embeds from a message

我使用订单系统(面向开发人员)为我的 Minecraft 服务器制作了自己的 Discord 机器人。

当您对订单消息做出反应时,消息应编辑为 The Order was claimed by @Discord

这行得通,但我还想删除发送的 EmbedMessage。

但是不存在像message.removeEmbeds()message.deleteEmbeds()这样的方法。

那怎么可能呢?

MessageAction 的文档说明:

When updating a Message, unset fields will be ignored by default. To override existing fields with no value (remove content) you can use override(true). Setting this to true will cause all fields to be considered and will override the Message entirely causing unset values to be removed from that message. This can be used to remove existing embeds from a message:

message.editMessage("This message had an embed").override(true).queue()