edit ephemeral reply

Hello, is there a way to edit an ephemeral reply ?
11 Replies
d.js toolkit
d.js toolkit6mo 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 OP
d.js docs
d.js docs6mo ago
:method: ButtonInteraction#editReply() discord.js@14.19.3 Edits a reply to this interaction.
// Edit the initial reply to this interaction
interaction.editReply('New content')
.then(console.log)
.catch(console.error);
// Edit the initial reply to this interaction
interaction.editReply('New content')
.then(console.log)
.catch(console.error);
Joan Chassagne 1A
Joan Chassagne 1AOP6mo ago
Yes, but when I click on a button, I want to edit the message attached
Joan Chassagne 1A
Joan Chassagne 1AOP6mo ago
When I click on "validate", I want to edit "salut" to "hello"
No description
d.js docs
d.js docs6mo ago
:method: ButtonInteraction#update() discord.js@14.19.3 Updates the original message of the component on which the interaction was received on.
// Remove the components from the message
interaction.update({
content: "A component interaction was received",
components: []
})
.then(console.log)
.catch(console.error);
// Remove the components from the message
interaction.update({
content: "A component interaction was received",
components: []
})
.then(console.log)
.catch(console.error);
Joan Chassagne 1A
Joan Chassagne 1AOP6mo ago
@treble/luna yes already tried, but I still don't want to work : (node:25280) Warning: Supplying "ephemeral" for interaction response options is deprecated. And with flags, I have the same error
Amgelo
Amgelo6mo ago
and also that's not an error, it's a warn so it should still work, it'll just log that in the console
duck
duck6mo ago
though with the above in mind, I imagine the warning isn't coming from an update call since it'd just be ignored entirely given that you say "with flags, I have the same error", I'd guess it's coming from a different part of your code (one you could find with a cli flag the warning probably mentions)
Joan Chassagne 1A
Joan Chassagne 1AOP6mo ago
okay, but I can't do interaction.message.edit() ?
Amgelo
Amgelo6mo ago
and you need to consume the button interaction, not ignore it so you 100% need a reply(), update() or any defer with an editReply after you're done otherwise it'll show an error to the user
Joan Chassagne 1A
Joan Chassagne 1AOP6mo ago
yeahhh, but It's when I click on a button, I want to modify the message associated, I don't have access to the first reaction (when I send the first reply) wait, I don't know what I have changed, but it works, i think it comes from another part of the code thanks both of u

Did you find this page helpful?