get EmbedBuilder from Embed object

is it possible to get an embed builder instance from an embed object? I am trying to edit an already sent message's embed using the EmbedBuilder methods. Example:
const previousEmbed = interaction.message.embeds[0]

interaction.message.edit({
embeds: [previousEmbed.setTitle('Test')]
})
const previousEmbed = interaction.message.embeds[0]

interaction.message.edit({
embeds: [previousEmbed.setTitle('Test')]
})
9 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
MrMythical
MrMythical3y ago
EmbedBuilder.from(embed) Like EmbedBuilder.from(previousEmbed).setTitle(...)
yibuh
yibuhOP3y ago
Nothing about a from method in the docs, but i will try that ty 🙂
d.js docs
d.js docs3y ago
Documentation suggestion for @yibuh:method (static) EmbedBuilder.from() Creates a new embed builder from JSON data
MrMythical
MrMythical3y ago
Right here
yibuh
yibuhOP3y ago
oh thank you I was looking for it on the builders section my bad (intermediate value).from is not a function
const prevEmbed = new EmbedBuilder().from(interaction.message.embeds[1]);
const prevEmbed = new EmbedBuilder().from(interaction.message.embeds[1]);
MrMythical
MrMythical3y ago
it's a static method
yibuh
yibuhOP3y ago
oh and how can I access it?
MrMythical
MrMythical3y ago
EmbedBuilder.from not an instance, the class itself
Want results from more Discord servers?
Add your server