y21

Untitled

y21
Sep 4th, 2020 (edited)
168
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const permissions = [
  2. 'CREATE_INSTANT_INVITE',
  3. 'KICK_MEMBERS',
  4. 'BAN_MEMBERS',
  5. 'ADMINISTRATOR',
  6. 'MANAGE_CHANNELS',
  7. 'MANAGE_GUILD',
  8. 'ADD_REACTIONS',
  9. 'VIEW_AUDIT_LOG',
  10. 'PRIORITY_SPEAKER',
  11. 'STREAM',
  12. 'VIEW_CHANNEL',
  13. 'SEND_MESSAGES',
  14. 'SEND_TTS_MESSAGES',
  15. 'MANAGE_MESSAGES',
  16. 'EMBED_LINKS',
  17. 'ATTACH_FILES',
  18. 'READ_MESSAGE_HISTORY',
  19. 'MENTION_EVERYONE',
  20. 'USE_EXTERNAL_EMOJIS',
  21. 'VIEW_GUILD_ANALYTICS',
  22. 'CONNECT',
  23. 'SPEAK',
  24. 'MUTE_MEMBERS',
  25. 'DEAFEN_MEMBERS',
  26. 'MOVE_MEMBERS',
  27. 'USE_VAD',
  28. 'CHANGE_NICKNAME',
  29. 'CHANGE_NICKNAMES',
  30. 'MANAGE_ROLES',
  31. 'MANAGE_WEBHOOKS',
  32. 'MANAGE_EMOJIS'
  33. ];
  34.  
  35. function bitfieldToArray(bitfield: number) {
  36. return permissions.filter((_, i) => {
  37. const current = 1 << i;
  38. return (bitfield & current) === current;
  39. });
  40. }
RAW Paste Data