2022-03-24 10:55:32 +00:00
'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 `
2022-06-04 07:50:16 +00:00
* * ` MFA_SMS `
* * ` PREMIUM_PROMO_DISMISSED `
2022-03-24 10:55:32 +00:00
* * ` HOUSE_BRAVERY `
* * ` HOUSE_BRILLIANCE `
* * ` HOUSE_BALANCE `
* * ` EARLY_SUPPORTER `
* * ` TEAM_USER `
2022-06-04 07:50:16 +00:00
* * ` INTERNAL_APPLICATION `
* * ` SYSTEM `
* * ` HAS_UNREAD_URGENT_MESSAGES `
2022-03-24 10:55:32 +00:00
* * ` BUGHUNTER_LEVEL_2 `
2022-06-04 07:50:16 +00:00
* * ` UNDERAGE_DELETED `
2022-03-24 10:55:32 +00:00
* * ` VERIFIED_BOT `
* * ` EARLY_VERIFIED_BOT_DEVELOPER `
* * ` DISCORD_CERTIFIED_MODERATOR `
* * ` BOT_HTTP_INTERACTIONS `
2022-06-04 07:50:16 +00:00
* * ` SPAMMER `
* * ` DISABLE_PREMIUM `
* * ` PREMIUM_DISCRIMINATOR `
* * ` USED_DESKTOP_CLIENT `
* * ` USED_WEB_CLIENT `
* * ` USED_MOBILE_CLIENT `
* * ` DISABLED `
* * ` VERIFIED_EMAIL `
2022-03-24 10:55:32 +00:00
* @ type { Object }
* @ see { @ link https : //discord.com/developers/docs/resources/user#user-object-user-flags}
2022-06-04 07:00:20 +00:00
* @ see { @ link https : //github.com/LewisTehMinerz/discord-flags}
2022-03-24 10:55:32 +00:00
* /
UserFlags . FLAGS = {
DISCORD _EMPLOYEE : 1 << 0 ,
PARTNERED _SERVER _OWNER : 1 << 1 ,
HYPESQUAD _EVENTS : 1 << 2 ,
BUGHUNTER _LEVEL _1 : 1 << 3 ,
2022-06-04 07:00:20 +00:00
MFA _SMS : 1 << 4 , // [Undocumented] User has SMS 2FA enabled.
PREMIUM _PROMO _DISMISSED : 1 << 5 , // [Undocumented] Presumably some sort of Discord Nitro promotion that the user dismissed.
2022-03-24 10:55:32 +00:00
HOUSE _BRAVERY : 1 << 6 ,
HOUSE _BRILLIANCE : 1 << 7 ,
HOUSE _BALANCE : 1 << 8 ,
EARLY _SUPPORTER : 1 << 9 ,
TEAM _USER : 1 << 10 ,
2022-06-04 07:50:16 +00:00
INTERNAL _APPLICATION : 1 << 11 , // [Undocumented] An internal flag accidentally leaked to the client's private flags. Relates to partner/verification applications but nothing else is known.
2022-06-04 07:00:20 +00:00
SYSTEM : 1 << 12 , // [Undocumented] Account is a Discord system account.
HAS _UNREAD _URGENT _MESSAGES : 1 << 13 , // [Undocumented] User has unread messages from Discord.
2022-03-24 10:55:32 +00:00
BUGHUNTER _LEVEL _2 : 1 << 14 ,
2022-06-04 07:00:20 +00:00
UNDERAGE _DELETED : 1 << 15 , // [Undocumented] Unused. User was deleted for being underage.
2022-03-24 10:55:32 +00:00
VERIFIED _BOT : 1 << 16 ,
EARLY _VERIFIED _BOT _DEVELOPER : 1 << 17 ,
DISCORD _CERTIFIED _MODERATOR : 1 << 18 ,
BOT _HTTP _INTERACTIONS : 1 << 19 ,
2022-07-06 12:40:17 +00:00
SPAMMER : Math . pow ( 2 , 20 ) , // [Undocumented] User is marked as a spammer.
DISABLE _PREMIUM : Math . pow ( 2 , 21 ) , // [Undocumented] Forcefully disables Nitro features.
PREMIUM _DISCRIMINATOR : Math . pow ( 2 , 37 ) , // [Undocumented] User has a premium discriminator.
USED _DESKTOP _CLIENT : Math . pow ( 2 , 38 ) , // [Undocumented] User has used the desktop client.
USED _WEB _CLIENT : Math . pow ( 2 , 39 ) , // [Undocumented] User has used the web client.
USED _MOBILE _CLIENT : Math . pow ( 2 , 40 ) , // [Undocumented] User has used the mobile client.
DISABLED : Math . pow ( 2 , 41 ) , // [Undocumented] User is currently temporarily or permanently disabled.
VERIFIED _EMAIL : Math . pow ( 2 , 43 ) , // [Undocumented] User has a verified email on their account.
2022-03-24 10:55:32 +00:00
} ;
module . exports = UserFlags ;