Allow editing ephemeral interaction responses through standard Edit Message endpoint #3342
-
Description Currently, it is possible to edit a non-ephemeral interaction response through the Edit Message endpoint (i.e. Get Original Interaction Response also currently returns a message object for ephemeral responses. However, using this message ID with Edit Message results in an "Unknown Message" error. Why This is Needed Interaction responses - ephemeral or not - can currently be edited through the interaction-specific endpoints, like Edit Original Interaction Response, and this works fine. However, after some time (quite a while, possibly hours, I haven't measured) the interaction token appears to become invalid, causing that endpoint to return "Invalid Webhook Token". While I can fall back on Edit Message for non-ephemeral responses, it does not work for ephemeral responses. The use case here is that responses from my bot sometimes contain embeds that I want to keep updated in response to future interactions which may occur hours or days later. Specifically, the bot is managing clan events, and the embeds it generates summarize the current state of the event (activity, description, date & time, who has signed up, etc.). If a user creates an event on Tuesday, and then another user joins the event on Wednesday, I still want to be able to update any messages where the embed may still exist. Even though ephemeral responses are, well, ephemeral, it is indeterminate exactly how long they may be visible to a user. For example, I currently have ephemeral responses from my WIP bot visible in a test server that are over 2 days old. Alternatives Considered Another alternative would be a way to get a refreshed interaction token sometime later, but treating the responses the same as any other message seems more straightforward. Barring either of those, I will have to avoid using ephemeral responses in many cases since it would be too confusing from the user's perspective if some but not all embeds were showing the latest event state. This is not ideal, since responses to most of my commands don't really need to be visible to anyone except the user that issued the command. This leads to undesirable, informal workarounds like creating a "bot-spam" channel to interact with the bot while avoiding clogging up other channels. Additional Details |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
Interaction tokens last 15 minutes. These ephemeral messages aren't stored in the backend for Discord. Fundamentally though, I think expecting an ephemeral message to last 2 days is unrealistic. I suspect most of these go away in less than 15 minutes. If you want your message to be long lasting then it should be a full message, not an ephemeral one.
Ephemeral messages are visible until either chat scrolls away or the user explicitly dismisses them. |
Beta Was this translation helpful? Give feedback.
-
It's not that I'm expecting them to last 2 days, it's that they do. If I could rely on them disappearing by the time the interaction token is invalid, then that would be great.
That doesn't seem to be the case. Like I mentioned, I have ephemeral responses that are visible to me days later and that are well past a single screen-height of chat scrollback, and in a client where I've been switching between and communicating in different servers (i.e. the channel hasn't been open the whole time). I can capture a short video to show this if you like. |
Beta Was this translation helpful? Give feedback.
-
I suppose another option would be deleting the response myself within the life of the token. It would be useful if it weren't necessary to do that manually, but I suppose that's a different feature request. |
Beta Was this translation helpful? Give feedback.
-
Well it seems like you can’t delete ephemeral responses either, only edit them. Delete just returns “Unknown message” as well. |
Beta Was this translation helpful? Give feedback.
-
I know this proposal has already been answered but I would like to bring it up to date. Conformity with everything said about most threads I could find on the subjectIndeed, ephemeral messages can be "dismissed" by the user. Except that if you do this, it doesn't prevent the bot from continuing to send messages thanks to follow-ups. This means that from the perspective of the Discord API, the token remains valid for 15 minutes no matter what. From my perspective, ephemeral messages seems to be one of the most used features by bots today. It would be cool to make the functionality of ephemeral messages consistent with how traditional messages work. Here is my idea. Deleting ephemeral messagesA token continues to be valid for 15 minutes, it does not change. However, if you explicitly ask the API to delete the ephemeral message, the token will be immediately revoked on the API side and the message deleted on the client side if not already dismissed. Editing ephemeral messages (without user interaction)As we all know an interaction can be dismissed by the user. However, this is only done on the client side (as far as I know, don't hesitate to correct me if I am wrong). If the follow-ups can continue to be sent after the message has been dismissed, this means that we could be doing something right. If we want to modify an ephemeral message without user interaction, we have to consider two cases.
In the second case, the message editing behavior works exactly like the follow-ups, it causes a new * BUT, from the point of view of the Discord API, since the message is ephemeral, the bot must specify when editing the message that it is ephemeral, because there is no way of knowing whether the message that was dismissed was ephemeral or not. Sorry if I wasn't allowed to wake this up. |
Beta Was this translation helpful? Give feedback.
-
UPDATE: It's now possible ! |
Beta Was this translation helpful? Give feedback.
Interaction tokens last 15 minutes.
These ephemeral messages aren't stored in the backend for Discord. Fundamentally though, I think expecting an ephemeral message to last 2 days is unrealistic. I suspect most of these go away in less than 15 minutes. If you want your message to be long lasting then it should be a full message, not an ephemeral one.
Ephemeral messages are visible until…