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(Interaction): add memberPermissions #6741

Merged
merged 7 commits into from
Oct 3, 2021
Merged

feat(Interaction): add memberPermissions #6741

merged 7 commits into from
Oct 3, 2021

Conversation

ObscuritySRL
Copy link
Contributor

@ObscuritySRL ObscuritySRL commented Oct 2, 2021

Please describe the changes this PR makes and why it should be merged:
Implements <Interaction>.member.permissions, if exists, sent with an interaction. null if the interaction was sent via DM.

Attempting to fetch an uncached channel without VIEW_CHANNEL will result in a Missing Access error. However, interactions can still be received and responded to in channels which a bot does not have VIEW_CHANNEL for. Unless we use <Interaction>.member.permissions sent with the interaction , it's impossible to get the permissions of a member in an uncached channel.

Large bots which cannot afford to cache tens of millions of channels, roles, and permissions, could rely on the permissions sent with the interaction.

Status and versioning classification:

  • 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)

src/structures/Interaction.js Outdated Show resolved Hide resolved
src/structures/Interaction.js Outdated Show resolved Hide resolved
ObscuritySRL and others added 2 commits October 2, 2021 10:09
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
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 suppose these should be immutable!

src/structures/Interaction.js Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
src/structures/Interaction.js Outdated Show resolved Hide resolved
ObscuritySRL and others added 3 commits October 2, 2021 11:45
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Copy link
Contributor

@ImRodry ImRodry left a comment

Choose a reason for hiding this comment

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

Title should say feat(Interaction): add memberPermissions or something similar, otherwise LGTM

@ObscuritySRL ObscuritySRL changed the title Added memberPermissions to Interaction feat(Interaction): add memberPermissions Oct 3, 2021
@iCrawl iCrawl merged commit 28d96e3 into discordjs:main Oct 3, 2021
@ObscuritySRL ObscuritySRL deleted the interaction_member_permissions branch October 3, 2021 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants