Skip to content

Deleting an ephemeral message #2705

Closed Answered by Misha-133
Nekonika asked this question in Q&A
Jun 22, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Well
Using the IUserMessage returned by FollowupAsync() is actually the right way here.
You just need to cast it to RestFollowupMessage & call DeleteAsync() on it. It will make a call to Delete Followup Message endpoint and delete the msg.

just a small example

var msg = await FollowupAsync(...) as RestFollowupMessage;
_ = Task.Delay(TimeSpan.FromSeconds(5)).ContinueWith(_ =>msg.DeleteAsync()));

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Nekonika
Comment options

@Misha-133
Comment options

@Nekonika
Comment options

Answer selected by Nekonika
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants