简体   繁体   English

Discord.js V14如何编辑已发送的嵌入?

[英]Discord.js V14 how to edit an embed already sent?

Im doing a fake giveaway system and i need to edit the "giveaway started" embed message with "giveaway ended" embed message example我在做一个假赠品系统,我需要用“赠品结束”嵌入消息示例编辑“赠品开始”嵌入消息

I couldn t find a solution for it我找不到解决方案

You can store your message in a variable and then edit it when you need it.您可以将消息存储在变量中,然后在需要时对其进行编辑。

const MSG = await message.channel.send({embeds: [yourEmbed]});

// Create a new Embed with which you're going to edit the message

const basicEmbed = new EmbedBuilder()
.setDescription("Example")

// Then edit your original message

MSG.edit({embeds: [basicEmbed}});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM