60 lines
1.4 KiB
JavaScript
60 lines
1.4 KiB
JavaScript
|
'use strict';
|
||
|
const BitField = require('./BitField');
|
||
|
|
||
|
/**
|
||
|
* Data structure that makes it easy to interact with a {@link User#flags} bitfield.
|
||
|
* @extends {BitField}
|
||
|
*/
|
||
|
class UserFlags extends BitField {}
|
||
|
|
||
|
/**
|
||
|
* @name UserFlags
|
||
|
* @kind constructor
|
||
|
* @memberof UserFlags
|
||
|
* @param {BitFieldResolvable} [bits=0] Bit(s) to read from
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Bitfield of the packed bits
|
||
|
* @type {number}
|
||
|
* @name UserFlags#bitfield
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Numeric user flags. All available properties:
|
||
|
* * `DISCORD_EMPLOYEE`
|
||
|
* * `PARTNERED_SERVER_OWNER`
|
||
|
* * `HYPESQUAD_EVENTS`
|
||
|
* * `BUGHUNTER_LEVEL_1`
|
||
|
* * `HOUSE_BRAVERY`
|
||
|
* * `HOUSE_BRILLIANCE`
|
||
|
* * `HOUSE_BALANCE`
|
||
|
* * `EARLY_SUPPORTER`
|
||
|
* * `TEAM_USER`
|
||
|
* * `BUGHUNTER_LEVEL_2`
|
||
|
* * `VERIFIED_BOT`
|
||
|
* * `EARLY_VERIFIED_BOT_DEVELOPER`
|
||
|
* * `DISCORD_CERTIFIED_MODERATOR`
|
||
|
* * `BOT_HTTP_INTERACTIONS`
|
||
|
* @type {Object}
|
||
|
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-flags}
|
||
|
*/
|
||
|
UserFlags.FLAGS = {
|
||
|
DISCORD_EMPLOYEE: 1 << 0,
|
||
|
PARTNERED_SERVER_OWNER: 1 << 1,
|
||
|
HYPESQUAD_EVENTS: 1 << 2,
|
||
|
BUGHUNTER_LEVEL_1: 1 << 3,
|
||
|
HOUSE_BRAVERY: 1 << 6,
|
||
|
HOUSE_BRILLIANCE: 1 << 7,
|
||
|
HOUSE_BALANCE: 1 << 8,
|
||
|
EARLY_SUPPORTER: 1 << 9,
|
||
|
TEAM_USER: 1 << 10,
|
||
|
BUGHUNTER_LEVEL_2: 1 << 14,
|
||
|
VERIFIED_BOT: 1 << 16,
|
||
|
EARLY_VERIFIED_BOT_DEVELOPER: 1 << 17,
|
||
|
DISCORD_CERTIFIED_MODERATOR: 1 << 18,
|
||
|
BOT_HTTP_INTERACTIONS: 1 << 19,
|
||
|
};
|
||
|
|
||
|
module.exports = UserFlags;
|