Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/structures/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class Role extends SnowflakeBase {
icon?: string
unicodeEmoji?: string
position!: number
/** Use `edit` method to update permissions */
permissions!: Permissions
managed!: boolean
mentionable!: boolean
Expand Down
6 changes: 3 additions & 3 deletions src/utils/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BitField, BitFieldResolvable } from './bitfield.ts'

export type PermissionResolvable = BitFieldResolvable

/** Manages Discord's Bit-based Permissions */
/** Represents permissions BitField */
export class Permissions extends BitField {
static DEFAULT = 104324673n
static ALL = Object.values(PermissionFlags).reduce(
Expand All @@ -19,14 +19,14 @@ export class Permissions extends BitField {
any(permission: PermissionResolvable, checkAdmin = true): boolean {
return (
(checkAdmin && super.has(this.flags().ADMINISTRATOR)) ||
super.any(permission as any)
super.any(permission)
)
}

has(permission: PermissionResolvable, checkAdmin = true): boolean {
return (
(checkAdmin && super.has(this.flags().ADMINISTRATOR)) ||
super.has(permission as any)
super.has(permission)
)
}
}