Fetch ephemeral message

Is it possible to store the id of a message and then fetch it later on in order to delete it? I was able to delete the message if i store the promise<message> but otherwise I couldn’t find a way to delete an ephemeral message
16 Replies
d.js toolkit
d.js toolkit2y ago
• 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.
d.js docs
d.js docs2y ago
method CommandInteraction#deleteReply() Deletes a reply to this interaction.
Shahar
ShaharOP2y ago
Do I need to save the “message” object in order to do it? Because I try to avoid storing it I understand, thank you very much, if you have any example to supply me it would be wonderful , I didn’t mess with thewe hook just yet
Shahar
ShaharOP2y ago
Shahar
ShaharOP2y ago
is it possible to send ephemeral in webhook?
Shahar
ShaharOP2y ago
here im trying to delete the message that i have saved
Shahar
ShaharOP2y ago
error:
Shahar
ShaharOP2y ago
how can I do that? I know at the first time the message would be null, I want to delete it at the second time so i can switch between the messages that is what I am trying to implement webhookClient.send( { content:'example',flags: MessageFlags.FLAGS.EPHEMERAL}) like this? But the problem also he cant know who to send it to
Shahar
ShaharOP2y ago
I tried so many different ways, cant get it done unfortunately, This is what i got now:
Shahar
ShaharOP2y ago
error:
Shahar
ShaharOP2y ago
Thank you very much!, its working!! , can you explain me a little bit about it? more info about '@original' and info about the advantages of creating a webhook for each channel instead of simply replaying to interactions In addition, what is more efficient, saving the token of a message and deleting it using a webhook compared to saving the Message.id and then deleting it afterwards
Shahar
ShaharOP2y ago
Because if Im saving an id of a message I need to iterate and fetch a message that sent in the channel for example:
Shahar
ShaharOP2y ago
Thank you very much! it clarify everything!
Shahar
ShaharOP2y ago
again, I am having trouble deleting the last message, what is the problem over here?
Shahar
ShaharOP2y ago
Shahar
ShaharOP2y ago
if you can have a look it will be wonderful I am so sorry, my bad, I successfully stored the id of the message, in fact I am replaying for MenuUserSelection, what I am attempting to do is to edit the embed message in order to show the members that the user have been chosen , when I try to edit the message when interaction is created the error is that it can’t find a message The same message that contains the components and the embeds Ohhh, thank you! Thank you so much
Want results from more Discord servers?
Add your server