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 GuildMembers 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.

Extends

BitField<PermissionsString, bigint>
Static
All:bigint
Bitfield representing every permission combined
bitfield:N
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<S>
add(...bits):BitField<S, N>
Adds bits to these ones.
Returns
These bits or new BitField if the instance is frozen.
NameTypeOptionalDescription
...bitsBitFieldResolvable<S, N>[]NoBits to add
Inherited from BitField
any(permission, checkAdmin?):boolean
Checks whether the bitfield has a permission, or any of multiple permissions.
NameTypeOptionalDescription
permissionPermissionResolvableNoPermission(s) to check for
checkAdminbooleanYesWhether to allow the administrator permission to override
equals(bit):boolean
Checks if this bitfield equals another
NameTypeOptionalDescription
bitBitFieldResolvable<S, N>NoBit(s) to check for
Inherited from BitField
freeze():Readonly<BitField<S, N>>
Freezes these bits, making them immutable.
Inherited from BitField
has(permission, checkAdmin?):boolean
Checks whether the bitfield has a permission, or multiple permissions.
NameTypeOptionalDescription
permissionPermissionResolvableNoPermission(s) to check for
checkAdminbooleanYesWhether 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>NoBit(s) to check for
checkAdminbooleanYesWhether to allow the administrator permission to override
remove(...bits):BitField<S, N>
Removes bits from these.
Returns
These bits or new BitField if the instance is frozen.
NameTypeOptionalDescription
...bitsBitFieldResolvable<S, N>[]NoBits to remove
Inherited from BitField
Static
resolve(permission?):bigint
NameTypeOptionalDescription
permissionPermissionResolvableYesNone
serialize(hasParams?):Record<PermissionsString, boolean>
Gets an object mapping field names to a indicating whether the bit is available.
NameTypeOptionalDescription
hasParamsbooleanYesAdditional parameters for the has method, if any
toArray():PermissionsString[]
Gets an of bitfield names based on the permissions available.
toJSON():N extends number ? number : string
valueOf():N