From 69f26930b01822d8f3ffb95669762c16ec118725 Mon Sep 17 00:00:00 2001 From: Skillz Date: Sat, 30 May 2020 16:53:53 -0400 Subject: [PATCH] refactoring --- handlers/member.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/handlers/member.ts b/handlers/member.ts index 0d86c3cd4..3d6517999 100644 --- a/handlers/member.ts +++ b/handlers/member.ts @@ -60,24 +60,24 @@ export function addRole( /** Remove a role from the member */ export function removeRole( - guild: Guild, + guildID: string, memberID: string, roleID: string, reason?: string, ) { - const botsHighestRole = highestRole(guild.id, botID); + const botsHighestRole = highestRole(guildID, botID); if ( botsHighestRole && - !higherRolePosition(guild.id, botsHighestRole.id, roleID) + !higherRolePosition(guildID, botsHighestRole.id, roleID) ) { throw new Error(Errors.BOTS_HIGHEST_ROLE_TOO_LOW); } - if (!botHasPermission(guild.id, [Permissions.MANAGE_ROLES])) { + if (!botHasPermission(guildID, [Permissions.MANAGE_ROLES])) { throw new Error(Errors.MISSING_MANAGE_ROLES); } return RequestManager.delete( - endpoints.GUILD_MEMBER_ROLE(guild.id, memberID, roleID), + endpoints.GUILD_MEMBER_ROLE(guildID, memberID, roleID), { reason }, ); }