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

feat(InteractionResponses): support with_response query parameter #10499

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

monbrey
Copy link
Member

@monbrey monbrey commented Sep 12, 2024

Please describe the changes this PR makes and why it should be merged:
Closes #10498

/core done in #10512

Upstream: discord/discord-api-docs#7106

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Oct 2, 2024 11:10am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Oct 2, 2024 11:10am

@Jiralite
Copy link
Member

Jiralite commented Sep 12, 2024

This also required a discord-api-types version bump

We'll wait for #10488 before this one lands.

Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the interaction callback resource contains any message created. If this is a good enough alternative to options.fetchReply, I say we should deprecate it.

packages/discord.js/src/structures/InteractionCallback.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/InteractionCallback.js Outdated Show resolved Hide resolved
packages/discord.js/src/structures/InteractionCallback.js Outdated Show resolved Hide resolved
packages/discord.js/package.json Outdated Show resolved Hide resolved
packages/discord.js/src/index.js Show resolved Hide resolved
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.49%. Comparing base (cda8d88) to head (8b69bd4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10499      +/-   ##
==========================================
+ Coverage   35.48%   35.49%   +0.01%     
==========================================
  Files         228      228              
  Lines       14308    14303       -5     
  Branches     1254     1254              
==========================================
  Hits         5077     5077              
+ Misses       9187     9182       -5     
  Partials       44       44              
Flag Coverage Δ
guide 0.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jiralite
Copy link
Member

Jiralite commented Oct 2, 2024

Please resolve conflicts!

Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve conflicts!

this.interaction = new InteractionCallback(client, data.interaction);

/**
* The resource that was created by the interaction response
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The resource that was created by the interaction response
* The resource that was created by the interaction response

Comment on lines +30 to +40
/**
* The id of the channel the original interaction was sent in
* @type {?Snowflake}
*/
this.channelId = data.channel_id ?? null;

/**
* The id of the guild the original interaction was sent in
* @type {Snowflake}
*/
this.guildId = data.guild_id ?? null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties appear to be undocumented. I believe they should be removed, if I'm not mistaken.
https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

Use optional query parameter when posting interaction callbacks
3 participants