Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide interaction response message data when using /callback #3153

Closed
SpencerSharkey opened this issue Jun 21, 2021 · 4 comments
Closed

Provide interaction response message data when using /callback #3153

SpencerSharkey opened this issue Jun 21, 2021 · 4 comments
Labels

Comments

@SpencerSharkey
Copy link

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.

@typpo typpo added feature request synced Synced to internal tracker labels Jun 21, 2021
@applebee1558
Copy link
Contributor

For non-ephemeral messages, you could just listen for MESSAGE_CREATES on the gateway that have the same interaction id, and I don't get why you would need the message data for ephemeral messages? (they don't get stored)

@artem30801
Copy link

Message id of ephemeral message could be useful for handling component interactions, for example

@applebee1558
Copy link
Contributor

@artem30801 ah I see, sorry about that. I never used buttons on ephemeral messages so I never thought of that use-case

@discord discord locked and limited conversation to collaborators Jul 1, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

7 participants
@typpo @IanMitchell @SpencerSharkey @applebee1558 @artem30801 and others