fix(Permissions): allow admin to override in the missing method (#5911)

This commit is contained in:
SpaceEEC
2021-06-24 21:42:40 +02:00
committed by GitHub
parent e0efcc6ab0
commit ee025b0558

View File

@@ -24,6 +24,16 @@ class Permissions extends BitField {
* @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.
* @param {PermissionResolvable} permission Permission(s) to check for