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

fixed permissions getter like channel::get_user_permissions #426

Merged
merged 12 commits into from
Jun 23, 2022

Conversation

Commandserver
Copy link
Member

@Commandserver Commandserver commented Jun 19, 2022

The following permissions getters calculated the permissions wrong. Discord probably changed the permission hierarchy. However the methods didn't follow the correct permission hierarchy.

  • channel::get_user_permissions()
  • guild::base_permissions()
  • guild::permission_overwrites()

btw some of them didn't checked for null pointer.

I also added the same getters with guild_member param and references instead of pointers, because the don't require the user cache then.
Im wondering why the old ones got the user param, as they're immediately searching for the guild member in cache and doesn't really need the user.
They all still requires the role cache as they go through the roles etc.

I also updated some comments in this pr :)

The whole thing is tested of course.

Additional Content
https://discord.com/developers/docs/topics/permissions#permission-overwrites

@Commandserver Commandserver marked this pull request as draft June 19, 2022 18:37
@Commandserver Commandserver marked this pull request as ready for review June 22, 2022 17:27
@Commandserver Commandserver changed the title updating permissions getter & some docs fixed permissions getter like channel::get_user_permissions Jun 22, 2022
@braindigitalis braindigitalis merged commit e12f92e into brainboxdotcc:dev Jun 23, 2022
@braindigitalis braindigitalis linked an issue Jun 24, 2022 that may be closed by this pull request
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.

permissions getter for members
2 participants