Skip to content

UserFlags

classe · Source

Data structure that makes it easy to interact with a User#flags bitfield.

Extends: BitField

Constructor

new UserFlags(bits?: BitFieldResolvable)

Parameters

NameTypeDescription
bits?BitFieldResolvableBit(s) to read from Default: 0.

Properties

bitfield

bitfield: number

Bitfield of the packed bits Source

FLAGS

static

FLAGS: Object

Numeric user flags. All available properties:

  • DISCORD_EMPLOYEE
  • PARTNERED_SERVER_OWNER
  • HYPESQUAD_EVENTS
  • BUGHUNTER_LEVEL_1
  • MFA_SMS
  • PREMIUM_PROMO_DISMISSED
  • HOUSE_BRAVERY
  • HOUSE_BRILLIANCE
  • HOUSE_BALANCE
  • EARLY_SUPPORTER
  • TEAM_USER
  • INTERNAL_APPLICATION
  • SYSTEM
  • HAS_UNREAD_URGENT_MESSAGES
  • BUGHUNTER_LEVEL_2
  • UNDERAGE_DELETED
  • VERIFIED_BOT
  • EARLY_VERIFIED_BOT_DEVELOPER
  • DISCORD_CERTIFIED_MODERATOR
  • BOT_HTTP_INTERACTIONS
  • SPAMMER
  • DISABLE_PREMIUM
  • ACTIVE_DEVELOPER
  • HIGH_GLOBAL_RATE_LIMIT
  • DELETED
  • DISABLED_SUSPICIOUS_ACTIVITY
  • SELF_DELETED
  • PREMIUM_DISCRIMINATOR
  • USED_DESKTOP_CLIENT
  • USED_WEB_CLIENT
  • USED_MOBILE_CLIENT
  • DISABLED
  • VERIFIED_EMAIL
  • QUARANTINED
  • COLLABORATOR
  • RESTRICTED_COLLABORATORSource

Methods

any

any(bit: BitFieldResolvable): boolean

Checks whether the bitfield has a bit, or any of multiple bits. Parameters

NameTypeDescription
bitBitFieldResolvableBit(s) to check for

Returns: booleanSource

equals

equals(bit: BitFieldResolvable): boolean

Checks if this bitfield equals another Parameters

NameTypeDescription
bitBitFieldResolvableBit(s) to check for

Returns: booleanSource

has

has(bit: BitFieldResolvable): boolean

Checks whether the bitfield has a bit, or multiple bits. Parameters

NameTypeDescription
bitBitFieldResolvableBit(s) to check for

Returns: booleanSource

missing

missing(bits: BitFieldResolvable, hasParams: *): Array<string>

Gets all given bits that are missing from the bitfield. Parameters

NameTypeDescription
bitsBitFieldResolvableBit(s) to check for
hasParams*Additional parameters for the has method, if any

Returns: Array<string>Source

freeze

freeze(): Readonly<BitField>

Freezes these bits, making them immutable. Returns: Readonly<BitField>Source

add

add(bits?: BitFieldResolvable): BitField

Adds bits to these ones. Parameters

NameTypeDescription
bits?BitFieldResolvableBits to add

Returns: BitField — These bits or new BitField if the instance is frozen. Source

remove

remove(bits?: BitFieldResolvable): BitField

Removes bits from these. Parameters

NameTypeDescription
bits?BitFieldResolvableBits to remove

Returns: BitField — These bits or new BitField if the instance is frozen. Source

serialize

serialize(hasParams: *): Object

Gets an object mapping field names to a boolean indicating whether the bit is available. Parameters

NameTypeDescription
hasParams*Additional parameters for the has method, if any

Returns: ObjectSource

toArray

toArray(hasParams: *): Array<string>

Gets an Array of bitfield names based on the bits available. Parameters

NameTypeDescription
hasParams*Additional parameters for the has method, if any

Returns: Array<string>Source

Unofficial software. Not affiliated with or supported by Discord.