Guest User

Untitled

a guest
Jan 15th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. enum DiscordPermissions {
  2.  
  3. CREATE_INSTANT_INVITE = 0x1,
  4. KICK_MEMBERS = 0x2,
  5. BAN_MEMBERS = 0x4,
  6. ADMINISTRATOR = 0x8,
  7. MANAGE_CHANNELS = 0x10,
  8. MANAGE_GUILD = 0x20,
  9. ADD_REACTIONS = 0x40,
  10. VIEW_AUDIT_LOG = 0x80,
  11. VIEW_CHANNEL = 0x400,
  12. SEND_MESSAGE = 0x800,
  13. SEND_TTS_MESSAGES = 0x1000,
  14. MANAGE_MESSAGES = 0x2000,
  15. EMBED_LINKS = 0x4000,
  16. ATTACH_FILES = 0x8000,
  17. READ_MESSAGE_HISTORY = 0x10000,
  18. MENTION_EVERYONE = 0x20000,
  19. USE_EXTERNAL_EMOJIS = 0x40000,
  20. CONNECT = 0x100000,
  21. SPEAK = 0x200000,
  22. MUTE_MEMBERS = 0x400000,
  23. DEAFEN_MEMBERS = 0x800000,
  24. MOVE_MEMBERS = 0x1000000,
  25. USE_VAD = 0x2000000,
  26. PRIORITY_SPEAKER = 0x100,
  27. CHANGE_NICKNAME = 0x4000000,
  28. MANAGE_NICKNAMES = 0x8000000,
  29. MANAGE_ROLES = 0x10000000,
  30. MANAGE_WEBHOOKS = 0x20000000,
  31. MANAGE_EMOJIS = 0x40000000
  32.  
  33. };
  34.  
  35. int32_t permCombined;
  36.  
  37. // Allocate 29 slots for permissions.
  38. int32_t hasPermissions[29];
  39.  
  40. int i;
  41. for(int perm = CREATE_INSTANT_INVITE; perm <= MANAGE_EMOJIS; ++perm)
  42. {
  43. if((permCombined | perm) == perm)
  44. hasPermissions[i] = perm;
  45. ++i;
  46. }
Add Comment
Please, Sign In to add comment