HasFlag was checking if any of the flags were set, not the ones
specified, and ResolveChannel was still treating the ChannelPermission
enum as before it was changed to a bitflag.
This resolves#824.
Discord seems to have inconsistencies where a role can be deleted, but
there will still be a few users who still have it in their `role_ids`. I
was able to find this bug appearing in 11 members of a 10,000 member
guild, so it would make sense that this is relatively rare, and it's why
we hadn't noticed it previously.
Since our permission resolution code is implementation agnostic, it
operates on the user's RoleIds collection, which is what Discord sends
us directly, and is not vaidated against the member's guild.
In our permission resolution code, we make the assumption that Discord
will always be telling us the truth with regard to a member's
`role_ids`. This PR changes the behavior of permissions resolution to
instead verify that the guild was able to return a role before
attempting to resolve its permissions.
* Fix#854 Added ViewChannel enum and property to channel permissions
* replaced usages of ChannelPermission#ReadMessages with ViewChannel
* rename parameter of ChannelPermissions constructor
* made OverwritePermissions#ReadMessages obsolete, use ViewChannel instead
* Fix#854 Added ViewChannel enum and property to channel permissions
replaced usages of ChannelPermission#ReadMessages with ViewChannel
rename parameter of ChannelPermissions constructor
made OverwritePermissions#ReadMessages obsolete, use ViewChannel instead
* renamed readMessages parameter in ChannelPermissions constructor and Modify
* fixed channel permission tests to use ChannelPermission enum instead of GuildPermission enum
* replaced usages of readmessages in channel permission tests
* resolve build warnings for permission tests
* Initial commit of changes. Changed permissions from bitwise index to use bitwise flags instead. Modified relevant methods involved
* Revised enum value naming
* Added FlagsAttribute to ChannelPermission, GuildPermission
* Added comments per Joe4evr suggestion
* Added underlines to hex value digits for readability per Joe4evr suggestion
* updated names to better reflect actual permission names as per SubZero0 suggestion
* fix for 236775c2d8
* Replaced Math.Pow with left shift operator
* Cleaned up the formatting of ChannelPermission and GuildPermission enums to make it easier to read