From 6adc8a9d0da153414413a46b01d5c273d0241e5b Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Fri, 2 Dec 2016 22:47:12 -0500 Subject: [PATCH] Move a getter around --- src/structures/Role.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/structures/Role.js b/src/structures/Role.js index c56035eb6..ce1b09025 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -110,6 +110,18 @@ class Role { return this.guild.members.filter(m => m.roles.has(this.id)); } + /** + * Whether the role is editable by the client user. + * @type {boolean} + * @readonly + */ + get editable() { + if (this.managed) return false; + const clientMember = this.guild.member(this.client.user); + if (!clientMember.hasPermission(Constants.PermissionFlags.MANAGE_ROLES_OR_PERMISSIONS)) return false; + return clientMember.highestRole.comparePositionTo(this) > 0; + } + /** * Get an object mapping permission names to whether or not the role enables that permission * @returns {Object} @@ -286,18 +298,6 @@ class Role { return this.client.rest.methods.deleteGuildRole(this); } - /** - * Whether the role is managable by the client user. - * @type {boolean} - * @readonly - */ - get editable() { - if (this.managed) return false; - const clientMember = this.guild.member(this.client.user); - if (!clientMember.hasPermission(Constants.PermissionFlags.MANAGE_ROLES_OR_PERMISSIONS)) return false; - return clientMember.highestRole.comparePositionTo(this) > 0; - } - /** * Whether this role equals another role. It compares all properties, so for most operations * it is advisable to just compare `role.id === role2.id` as it is much faster and is often