More concise way to edit sent embeds
I am currently dealing editing the fields of an existing embed as a reply, where I'm only changing the fields and not the base content. However, so far the only way I've seen to edit embeds is to redefine the entire embed. I tried making a
baseEmbed
which only containts setTitle()
, .setDescription
etc, and using .addFields()
for the editable content. However, .addFields()
mutates the existing embed rather than making a new one and as such it simply keeps adding new copies of the fields. Is there any way to get this to work without having to repeat the .setTitle()
etc.?5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!I may be wrong but I believe EmbedBuilder accepts an APIembed as a constructor
Unless I'm misunderstanding your question
Structures from the API cannot be edited directly. To do so, you can create a new structure (a builder) using the
.from()
method
as a side note,
<EmbedBuilder>.setFields()
exists and completely overwrites all fieldsthat's really useful, thank you