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
fix(GuildMember): properly check permissions for hasPermissions #4677
Conversation
This wouldn't fully work as expected, |
it would be a breaking change to remove the parameter, and even so works the same either way |
I'm not talking about removing the parameter, but the method needs to be changed because this PR makes it return |
Why would anyone want to see if guild owner has a role with specific permission? |
Please describe the changes this PR makes and why it should be merged:
This PR fixes a bug to do with
GuildMember.hasPermission
, to explain:if a server had 2 roles,
@everyone
andRole A
, if@everyone
only hadSEND_MESSAGES
, andRole A
only hadVIEW_CHANNEL
,GuildMember.hasPermission(['SEND_MESSAGES', 'VIEW_CHANNEL'])
would inaccurately returnfalse
, this is becauseGuildMember.hasPermission
checks if any of the members roles has the provided permissions, instead of combining all the permissions the member has, and then checking thatStatus
Semantic versioning classification: