#Discord permissions

1 messages · Page 1 of 1 (latest)

real patio
#

So, my API fetches the user's guilds from Discord's API, and inside of each guild object there is a permissions field.

So the question is:
How do I check if the user has like admin or manage_guild permission?

(I don't understand Discord's permissions system please help.)

chrome fern
#

convert to binary

real patio
#

And then?

chrome fern
#

do some bitshifts or check the nth bit

real patio
#

Can you show me some examples?

quartz thorn
#

Like:

if (int(permissions) & 0x8) == 0x8:
  # user as admin perms

if (int(permissions) & 0x20) == 0x20:
  # user has manage_guild perms
real patio
#

Thanks 🙏

broken ravine
#

@real patio use /solved