+
Skip to content

Update misleading docs for permissions property #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2022
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)
)
}
}
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载