diff --git a/packages/core/src/structures/special/permissions.ts b/packages/core/src/structures/special/permissions.ts index 5e02684..16dfaad 100644 --- a/packages/core/src/structures/special/permissions.ts +++ b/packages/core/src/structures/special/permissions.ts @@ -25,13 +25,21 @@ export class Permissions implements BitField { /** Stores all entity permissions */ bitfield: bigint; - /** Wheter to grant all other permissions to the administrator */ + /** + * Wheter to grant all other permissions to the administrator + * **Not to get confused with Permissions#admin** + */ __admin__ = true; constructor(bitfield: PermissionResolvable) { this.bitfield = Permissions.resolve(bitfield); } + /** Wheter the bitfield has the administrator flag */ + get admin(): boolean { + return (this.bitfield & BigInt(Permissions.Flags.ADMINISTRATOR)) === this.bitfield; + } + get array(): PermissionString[] { // unsafe cast, do not edit const permissions = Object.keys(Permissions.Flags) as PermissionString[];