mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
Webpack build for branch master: 21babf8859
This commit is contained in:
parent
857f72c214
commit
e8018eb080
2 changed files with 14 additions and 6 deletions
|
|
@ -2773,13 +2773,20 @@ class GuildMember {
|
|||
|
||||
/**
|
||||
* Checks if any of the member's roles have a permission.
|
||||
* @param {PermissionResolvable} permission The permission to check for
|
||||
* @param {boolean} [explicit=false] Whether to require the roles to explicitly have the exact permission
|
||||
* @param {PermissionResolvable|PermissionResolvable[]} permission Permission(s) to check for
|
||||
* @param {boolean} [explicit=false] Whether to require the role to explicitly have the exact permission
|
||||
* **(deprecated)**
|
||||
* @param {boolean} [checkAdmin] Whether to allow the administrator permission to override
|
||||
* (takes priority over `explicit`)
|
||||
* @param {boolean} [checkOwner] Whether to allow being the guild's owner to override
|
||||
* (takes priority over `explicit`)
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasPermission(permission, explicit = false) {
|
||||
if (!explicit && this.user.id === this.guild.ownerID) return true;
|
||||
return this.roles.some(r => r.hasPermission(permission, explicit));
|
||||
hasPermission(permission, explicit = false, checkAdmin, checkOwner) {
|
||||
if (typeof checkAdmin === 'undefined') checkAdmin = !explicit;
|
||||
if (typeof checkOwner === 'undefined') checkOwner = !explicit;
|
||||
if (checkOwner && this.user.id === this.guild.ownerID) return true;
|
||||
return this.roles.some(r => r.hasPermission(permission, undefined, checkAdmin));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2787,6 +2794,7 @@ class GuildMember {
|
|||
* @param {PermissionResolvable[]} permissions The permissions to check for
|
||||
* @param {boolean} [explicit=false] Whether to require the member to explicitly have the exact permissions
|
||||
* @returns {boolean}
|
||||
* @deprecated
|
||||
*/
|
||||
hasPermissions(permissions, explicit = false) {
|
||||
if (!explicit && this.user.id === this.guild.ownerID) return true;
|
||||
|
|
|
|||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue