[Slash Commands] How to OR/AND PermissionFlagsBits in defaultMemberPermissions? #6919
Unanswered
Zer0xxxx
asked this question in
API Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I'm implementing slash commands, and I would like to know how to build AND/OR PermissionFlagsBits conjunctions.
I think that doing this:
Produces a AND conjunction of all the
PermissionFlagsBits
.This is strange because I use the
|
binary operator, which means "OR"?So, maybe I have achieved the AND conjunction, idk.
But I don't know how to achieve the OR conjunction.
Also, I don't know how to produce the good packed binary value for designing something like this:
Which would mean:
Btw: this example is a bit meaningless.
What I'd like above all is to be able to understand the arithmetic behind it.
So that I can generalize it to any constructor where the
AND
andOR
bitflags must not overlap (flags in theOR
clause will be forbidden to be duplicated in theAND
clause, and vice versa).Thank you a lot for all kinds of help!
Also, I read the documentation here, and only see how to build
AND
conjunctionshttps://discord.com/developers/docs/topics/permissions
Beta Was this translation helpful? Give feedback.
All reactions