fix the bugs my nuke opened

This commit is contained in:
Skillz4Killz
2020-12-15 18:06:16 -05:00
parent aa39b1b62f
commit 370f397344

View File

@@ -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);
}
}