Skip to content
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

Use optional query parameter when posting interaction callbacks #10498

Open
almostSouji opened this issue Sep 11, 2024 · 0 comments · May be fixed by #10499
Open

Use optional query parameter when posting interaction callbacks #10498

almostSouji opened this issue Sep 11, 2024 · 0 comments · May be fixed by #10499

Comments

@almostSouji
Copy link
Member

almostSouji commented Sep 11, 2024

Which application or package is this feature request for?

discord.js

Feature

Currently, receiving the message created by an interaction response requires an additional API call

return options.fetchReply ? this.fetchReply() : new InteractionResponse(this);

Ideal solution or implementation

The interaction callback route https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response supports the with_response query string parameter, which we can utilize to avoid this call, optionally caching the created resource from the payload: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object

Alternative solutions or implementations

n/a

Other context

Note

We have to consider porting back the functionality of fetchReply (just applicable in case of CHANNEL_MESSAGE_WITH_SOURCE or UPDATE_MESSAGE) and additionally implementing a new function (or option parameter) which allows the full resource data to be returned (as this can also include an Activity instance id)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants