Webpack build for branch master: 21babf8859

This commit is contained in:
Travis CI 2017-03-07 07:55:05 +00:00
parent 857f72c214
commit e8018eb080
2 changed files with 14 additions and 6 deletions

View file

@ -2773,13 +2773,20 @@ class GuildMember {
/** /**
* Checks if any of the member's roles have a permission. * Checks if any of the member's roles have a permission.
* @param {PermissionResolvable} permission The permission to check for * @param {PermissionResolvable|PermissionResolvable[]} permission Permission(s) to check for
* @param {boolean} [explicit=false] Whether to require the roles to explicitly have the exact permission * @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} * @returns {boolean}
*/ */
hasPermission(permission, explicit = false) { hasPermission(permission, explicit = false, checkAdmin, checkOwner) {
if (!explicit && this.user.id === this.guild.ownerID) return true; if (typeof checkAdmin === 'undefined') checkAdmin = !explicit;
return this.roles.some(r => r.hasPermission(permission, 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 {PermissionResolvable[]} permissions The permissions to check for
* @param {boolean} [explicit=false] Whether to require the member to explicitly have the exact permissions * @param {boolean} [explicit=false] Whether to require the member to explicitly have the exact permissions
* @returns {boolean} * @returns {boolean}
* @deprecated
*/ */
hasPermissions(permissions, explicit = false) { hasPermissions(permissions, explicit = false) {
if (!explicit && this.user.id === this.guild.ownerID) return true; if (!explicit && this.user.id === this.guild.ownerID) return true;

File diff suppressed because one or more lines are too long