-
-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
bug 🐛Something isn't workingSomething isn't working
Description
What's the bug?
Permissions do not get correctly set in guild members, leading to issues when trying to check whether a member has a permission flag set.
How do we reproduce it?
- Have a (non-bot? unsure) account in a guild.
- Give it some role, which has some amount of permissions set on it. For me it had View Channels, Manage Server, Send Messages, Create Public Threads, Create Private Threads, Embed Links, Read Message History, Use Application Commands, Connect, Speak and Administrator roles.
- For completeness' sake, the @everyone role on this server has the following permissions: View Channels, Create Expressions, Send Messages, Send Messages in Threads, Create Public Threads, Create Private Threads, Embed Links, Use External Sticker, Read Message History, Use Application Commands, Send Voice Messages, Connect, Speak, Use Activities, Use Soundboard, Use External Sounds, Set Voice Channel Status, Create Events.
- Attempt to check whether it has the Administrator role:
message.member?.permissions.has(PermissionFlags.ADMINISTRATOR, true);What should have happened?
The above code returns true.
What is actually happening?
The above code returns false. Inspecting the bitfield variable on the permissions object (and printing it with .toString(2) for clarity) reveals that the fourth bit from the right is not set (number ends in 0001 instead of expected 1000), which was expected for the ADMINISTRATOR permission.
What versions you're using?
- OS: Zorin OS 16.3
- Deno: 1.37.0
- Harmony: 2.9.0
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't working