Check If Channel Permission is null

So basically i have a voice channel with permissions set for user ids. am having trouble figuring out how to check if a permission is "null" (grey slash)... when the grey slash is selected im getting false
9 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers.
Lick
LickOP17mo ago
so basically something like this but detect if the permission is specifically the grey slash if (permission.allow.has(PermissionsBitField.Flags.Connect) == false) this code snippet return true when grey slash is selected
SpecialSauce
SpecialSauce17mo ago
Are you talking about the channel overrides?
Lick
LickOP17mo ago
i think so yes to be clear these
Lick
LickOP17mo ago
i think i may have figured it out
permission.allow.has(PermissionsBitField.Flags.Connect, false) == false && permission.deny.has(PermissionsBitField.Flags.Connect, false) == false
permission.allow.has(PermissionsBitField.Flags.Connect, false) == false && permission.deny.has(PermissionsBitField.Flags.Connect, false) == false
this seems to return true when neutral and false if either allow or deny is set
SpecialSauce
SpecialSauce17mo ago
If you need to find the permissions in a specific channel for a member you can use <GuildMember>.permissionsIn(channelOrId) That would take into consideration any overrides for roles and members.
Lick
LickOP17mo ago
i have other conditions in place to ensure its a user, and im looping thru all permission overrides was just having trouble figuring out if neutral because before i had if (permission.allow.has(PermissionsBitField.Flags.Connect, false) == false) which was being evaluated as true for nuetral
SpecialSauce
SpecialSauce17mo ago
Right because it’s not specifically denying
Lick
LickOP17mo ago
anyways i think im all good i appreciate you ❤️ thanks @specialsauce oh thought the bot would give u karma
Want results from more Discord servers?
Add your server