From fdd376e3400be63a71792b685cd385a08df0fdb1 Mon Sep 17 00:00:00 2001 From: Shubham Parihar Date: Mon, 24 May 2021 19:50:54 +0530 Subject: [PATCH] fix(GuildEmojiRoleManager): bug in #remove --- src/managers/GuildEmojiRoleManager.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/managers/GuildEmojiRoleManager.js b/src/managers/GuildEmojiRoleManager.js index 5ed2d2fed1da..e4efa7815483 100644 --- a/src/managers/GuildEmojiRoleManager.js +++ b/src/managers/GuildEmojiRoleManager.js @@ -74,16 +74,16 @@ class GuildEmojiRoleManager { remove(roleOrRoles) { if (!Array.isArray(roleOrRoles) && !(roleOrRoles instanceof Collection)) roleOrRoles = [roleOrRoles]; - const resolvedRoles = []; + const resolvedRoleIDs = []; for (const role of roleOrRoles.values()) { - const resolvedRole = this.guild.roles.resolveID(role); - if (!resolvedRole) { + const roleID = this.guild.roles.resolveID(role); + if (!roleID) { return Promise.reject(new TypeError('INVALID_ELEMENT', 'Array or Collection', 'roles', role)); } - resolvedRoles.push(resolvedRole); + resolvedRoleIDs.push(roleID); } - const newRoles = this._roles.keyArray().filter(role => !resolvedRoles.includes(role.id)); + const newRoles = this._roles.keyArray().filter(id => !resolvedRoleIDs.includes(id)); return this.set(newRoles); }