Click a button and edit the embed
Good morning. I come to you because I would like that when I click on my button, my embed is modified. What I do is that I send my embed with the buttons via a
/testvalidation
command and I constantly check in interactionCreate
if it detects a click on the button. If this button is clicked then I ask him to take back the message stored in interaction
and therefore to create a new embed by defining each of the properties that I need and then to create a new button which corresponds to the same button as in my first embed and then modify the message to replace it with the new embed and the new buttons by doing interaction.edit({embeds: [Liste], components: [row]})
out it tells me that edit
is not a function...
Error :
8 Replies
• 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.You either want interaction.update() or interaction.message.edit(), interaction.edit() doesn't exist
So thank you, with interaction.message.edit() I have the change of my embed, however, I have a problem, no error in the console but an error on discord, he tells me that he there is an interaction failure even though it has done what I ask of it, any idea?
Yes because interaction.message.edit() isn't a response, you'd wanna use interaction.update() instead
ButtonInteraction#update()
Updates the original message of the component on which the interaction was received on.
It works the same but will count as a response
Okay thank you!
Of course