This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Provide interaction response message data when using /callback #3153
Labels
You can continue the conversation there. Go to discussion →
Description
It would be super useful to have the
/callback
endpoint return the newly created interaction response, with at least the new message's ID (ephemeral or not, should be treated the same).Why This is Needed
In the case where we are responding to interactions, especially slash command invocations, and needing to keep state for subsequent component interactions on that message, the message ID is the only common value to link on.
To accomplish this today, I thought we could make a GET request to
/@original,
but it appears it only works for non-ephemeral messages (see this comment on #2919). Additionally, this solution would require an additional call to the API after creating the message.Alternatives Considered
Similar to the premises of #2410, a message object could include the last interaction ID that touched it (including the creation of it). Later, an incoming component interaction event handler could use it to validate that an interaction event is acceptable given the last state of the interaction story. This would create a tree effect where new interactions could be easily linked to their "parent" interaction event, effectively providing the data needed to create a linked list of a message's interaction story from start to finish.
I don't know if this is possible given how ephemeral messages work, so I'm including it as a "this would be ideal" request.
Additional Details
Of course, we can do all this on the application side with some extra work: include some unique id in our app state and include it in all the custom_id fields, then link it on subsequent interactions. It would be great to make use of the data Discord (presumably) has available to simplify application code and make for snappier experiences.
The text was updated successfully, but these errors were encountered: