permissions.ts - fix highest role (#2393)

This commit is contained in:
Yaikava
2022-08-25 14:39:00 -04:00
committed by GitHub
parent 270116a474
commit de8f5215ca
+1 -1
View File
@@ -337,7 +337,7 @@ export function highestRole(
if (!guild) throw new Error(Errors.GUILD_NOT_FOUND);
// Get the roles from the member
const memberRoles = (typeof memberOrId === "bigint" ? bot.members.get(memberOrId) : memberOrId)
const memberRoles = (typeof memberOrId === "bigint" ? bot.members.get(bot.transformers.snowflake(`${memberOrId}${guild.id}`)) : memberOrId)
?.roles;
// This member has no roles so the highest one is the @everyone role
if (!memberRoles) return guild.roles.get(guild.id)!;