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
- 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.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 selectedAre you talking about the channel overrides?
i think so yes
to be clear these
i think i may have figured it out
this seems to return true when neutral and false if either allow or deny is set
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.
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 nuetralRight because it’s not specifically denying
anyways i think im all good i appreciate you ❤️
thanks @specialsauce
oh thought the bot would give u karma