How do you edit a specific message without it's interaction?

I'm using a button below a embed and I'm trying to edit the embed above the button when the button is clicked. Is there a way to do that?
const existingMessage = interaction.message;
if (existingMessage) {
// If there's an existing reply, edit it with the updated content
// Doesn't work since the interaction is currently the button
await interaction.editReply({ embeds: [memberEmbed], components: [buttonRow]});
} else {
// If there's no existing reply, send a new reply
await interaction.reply({ embeds: [memberEmbed], components: [buttonRow]});
// Works since the interaction is currently the message
await interaction.editReply({ embeds: [memberEmbed], components: [buttonRow]});
}
const existingMessage = interaction.message;
if (existingMessage) {
// If there's an existing reply, edit it with the updated content
// Doesn't work since the interaction is currently the button
await interaction.editReply({ embeds: [memberEmbed], components: [buttonRow]});
} else {
// If there's no existing reply, send a new reply
await interaction.reply({ embeds: [memberEmbed], components: [buttonRow]});
// Works since the interaction is currently the message
await interaction.editReply({ embeds: [memberEmbed], components: [buttonRow]});
}
No description
2 Replies
d.js toolkit
d.js toolkit8mo ago
- 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 staff
duck
duck8mo ago
if you'd like to respond to the button interaction by editing the button's message, consider using <ButtonInteraction>.update()