From cd3d3344e8c34e0950584b20bbe984b411fc23c5 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Sat, 28 Oct 2017 18:57:16 +0200 Subject: [PATCH] fix(GuildMember#hasPermission): pass correct parameters to Permissions#has (#2070) Also removed deprecated parameter of the method itself. --- src/structures/GuildMember.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index c4c2d6a81..935ba1084 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -294,19 +294,13 @@ class GuildMember extends Base { /** * Checks if any of the member's roles have a 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`) + * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override + * @param {boolean} [checkOwner=true] Whether to allow being the guild's owner to override * @returns {boolean} */ - hasPermission(permission, explicit = false, checkAdmin, checkOwner) { - if (typeof checkAdmin === 'undefined') checkAdmin = !explicit; - if (typeof checkOwner === 'undefined') checkOwner = !explicit; + hasPermission(permission, checkAdmin = true, checkOwner = true) { if (checkOwner && this.user.id === this.guild.ownerID) return true; - return this.roles.some(r => r.permissions.has(permission, undefined, checkAdmin)); + return this.roles.some(r => r.permissions.has(permission, checkAdmin)); } /**