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

Change members resolved objects to DiscordInteractionGuildMember instead of DiscordGuildMember #502

Merged

Conversation

MrPowerGamerBR
Copy link
Contributor

@MrPowerGamerBR MrPowerGamerBR commented Jan 25, 2022

Example of the resolved objects object:

{"data":{"type":1,"resolved":{"users":{"330416853971107840":{"username":"Welcomer","public_flags":589824,"id":"330416853971107840","discriminator":"5491","bot":true,"avatar":"5f65708fd35ee3844a463d5bf9fe7828"}},"members":{"330416853971107840":{"roles":["334711955736625185","401353261266763778","703308276770668634"],"premium_since":null,"permissions":"2199023255551","pending":false,"nick":null,"joined_at":"2020-04-24T18:16:00.039000+00:00","is_pending":false,"communication_disabled_until":null,"avatar":null}}}

Currently Kord uses DiscordGuildMember which does not have the permissions field, however Discord does provide the permissions field to resolved objects within an interaction.

By comparing Discord's documentation + the resolved objects map, it makes way more sense to use the DiscordInteractionGuildMember instead of DiscordGuildMember for the resolved objects map, because:

  • The permissions field is present, which isn't present in the DiscordGuildMember
  • Both mute and deafen fields are missing, which are not present in the DiscordInteractionGuildMember

MrPowerGamerBR added a commit to LorittaBot/DiscordInteraKTions that referenced this pull request Jan 25, 2022
MrPowerGamerBR added a commit to LorittaBot/DiscordInteraKTions that referenced this pull request Feb 9, 2022
…ace, use our own custom Kord fork for now (#22)

* Add more fields to the Member interface, add InteractionMember interface

Does not compile because kordlib/kord#502 needs to be merged first

* Use our own fork while Kord our changes aren't merged yet
@HopeBaron HopeBaron merged commit 5da4971 into kordlib:0.8.x Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants