mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
fix(Permissions): allow admin to override in the missing method (#5911)
This commit is contained in:
@@ -24,6 +24,16 @@ class Permissions extends BitField {
|
|||||||
* @typedef {string|bigint|Permissions|PermissionResolvable[]} PermissionResolvable
|
* @typedef {string|bigint|Permissions|PermissionResolvable[]} PermissionResolvable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all given bits that are missing from the bitfield.
|
||||||
|
* @param {BitFieldResolvable} bits Bit(s) to check for
|
||||||
|
* @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override
|
||||||
|
* @returns {string[]}
|
||||||
|
*/
|
||||||
|
missing(bits, checkAdmin = true) {
|
||||||
|
return checkAdmin && this.has(this.constructor.FLAGS.ADMINISTRATOR) ? [] : super.missing(bits, checkAdmin);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the bitfield has a permission, or any of multiple permissions.
|
* Checks whether the bitfield has a permission, or any of multiple permissions.
|
||||||
* @param {PermissionResolvable} permission Permission(s) to check for
|
* @param {PermissionResolvable} permission Permission(s) to check for
|
||||||
|
|||||||
Reference in New Issue
Block a user