From 370f3973443decf94e85184ddac650aff1d2f89a Mon Sep 17 00:00:00 2001 From: Skillz4Killz Date: Tue, 15 Dec 2020 18:06:16 -0500 Subject: [PATCH] fix the bugs my nuke opened --- src/handlers/member.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/handlers/member.ts b/src/handlers/member.ts index 52911e28d..f58850c2d 100644 --- a/src/handlers/member.ts +++ b/src/handlers/member.ts @@ -62,7 +62,10 @@ export async function addRole( botsHighestRole.id, roleID, ); - if (!hasHigherRolePosition) { + if ( + !hasHigherRolePosition && + (await cacheHandlers.get("guilds", guildID))?.ownerID !== botID + ) { throw new Error(Errors.BOTS_HIGHEST_ROLE_TOO_LOW); } } @@ -93,7 +96,10 @@ export async function removeRole( botsHighestRole.id, roleID, ); - if (!hasHigherRolePosition) { + if ( + !hasHigherRolePosition && + (await cacheHandlers.get("guilds", guildID))?.ownerID !== botID + ) { throw new Error(Errors.BOTS_HIGHEST_ROLE_TOO_LOW); } }