PermissionsBitField

export class PermissionsBitField extends BitField<PermissionsString, bigint>
export class PermissionsBitField extends BitField<PermissionsString, bigint>
Data structure that makes it easy to interact with a permission bitfield. All s have a set of permissions in their guild, and each channel in the guild may also have PermissionOverwrites for the member that override their default permissions.
Static
All:bigint
Bitfield representing every permission combined
bitfield:bigint
Bitfield of the packed bits
Inherited from BitField
Static
Default:bigint
Bitfield representing the default permissions for users
Static
StageModerator:bigint
Bitfield representing the permissions required for moderators of stage channels
[Symbol.iterator]():IterableIterator<PermissionsString>
Adds bits to these ones.
Returns
These bits or new BitField if the instance is frozen.
NameTypeOptionalDescription
...bitsBitFieldResolvable<PermissionsString, bigint>[]No
Bits to add
Inherited from BitField
any(permission, checkAdmin?):boolean
Checks whether the bitfield has a permission, or any of multiple permissions.
NameTypeOptionalDescription
permissionPermissionResolvableNo
Permission(s) to check for
checkAdminbooleanYes
Whether to allow the administrator permission to override
equals(bit):boolean
Checks if this bitfield equals another
NameTypeOptionalDescription
bitBitFieldResolvable<PermissionsString, bigint>No
Bit(s) to check for
Inherited from BitField
Freezes these bits, making them immutable.
Inherited from BitField
has(permission, checkAdmin?):boolean
Checks whether the bitfield has a permission, or multiple permissions.
NameTypeOptionalDescription
permissionPermissionResolvableNo
Permission(s) to check for
checkAdminbooleanYes
Whether to allow the administrator permission to override
missing(bits, checkAdmin?):PermissionsString[]
Gets all given bits that are missing from the bitfield.
NameTypeOptionalDescription
bitsBitFieldResolvable<PermissionsString, bigint>No
Bit(s) to check for
checkAdminbooleanYes
Whether to allow the administrator permission to override
Removes bits from these.
Returns
These bits or new BitField if the instance is frozen.
NameTypeOptionalDescription
...bitsBitFieldResolvable<PermissionsString, bigint>[]No
Bits to remove
Inherited from BitField
Static
resolve(permission?):bigint
NameTypeOptionalDescription
permissionPermissionResolvableYesNone
serialize(hasParams?):Record<PermissionsString, boolean>
Gets an object mapping field names to a boolean indicating whether the bit is available.
NameTypeOptionalDescription
hasParamsbooleanYes
Additional parameters for the has method, if any
toArray():PermissionsString[]
Gets an Array of bitfield names based on the permissions available.
toJSON():bigint extends number ? number : string
valueOf():bigint