Embed editting
Hello all,
I have been trying to get an embed field to edit once a button is clicked is this possible ?
12 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!
- ✅
Marked as resolved by OP<ButtonInteraction>.update() with your edited embeds
I have this :
replace the message.edit with what i said
Is their not a way of just changing a field rather than making a whole new embed
you can construct a builder from the embeds attached from the message
Seen you appear to have access to the original builder, you dont need to do this a'd can just edit directly
I cannot be getting this to work for some reason.
To be honest you have said ButtonInteraction.update()
But
that still doesn't explain how to edit a specific embed value
I believe @polarwolvinny ❄ 🌈 is saying to do something like this:
yeah but that code is wrong
Structures from the API cannot be edited directly. To do so, you can create a new structure (a builder) using the
.from()
method
You can just edit it like you would regularly
ex call setTitle and it's override
To replace a specific embed field, you can use
EmbedBuilder.spliceFields()
to change a specific field if you have fields in your embed
https://discord.js.org/docs/packages/builders/main/EmbedBuilder:Class#spliceFieldsbuilders | EmbedBuilder
A builder that creates API-compatible JSON data for embeds.