async function higherRolePosition(
  guildOrId,
  roleId,
  otherRoleId,
) {
  const guild = await getCached("guilds", guildOrId);
  if (!guild) return true;
  const role = guild.roles.get(roleId);
  const otherRole = guild.roles.get(otherRoleId);
  if (!role || !otherRole) throw new Error(Errors.ROLE_NOT_FOUND);
  // Rare edge case handling
  if (role.position === otherRole.position) {
    return role.id < otherRole.id;
  }
  return role.position > otherRole.position;
}
/** Checks if the first role is higher than the second role */
Checks if the first role is higher than the second role
Checks if the first role is higher than the second role
async function higherRolePosition(
  guildOrId,
  roleId,
  otherRoleId,
) {
  const guild = await getCached("guilds", guildOrId);
  if (!guild) return true;
  const role = guild.roles.get(roleId);
  const otherRole = guild.roles.get(otherRoleId);
  if (!role || !otherRole) throw new Error(Errors.ROLE_NOT_FOUND);
  if (role.position === otherRole.position) {
    return role.id < otherRole.id;
  }
  return role.position > otherRole.position;
}
async function higherRolePosition ( guildOrId , roleId , otherRoleId , ) { const guild = await getCached ( "guilds" , guildOrId ) ; if ( ! guild ) return true ; const role = guild . roles . get ( roleId ) ; const otherRole = guild . roles . get ( otherRoleId ) ; if ( ! role || ! otherRole ) throw new Error ( Errors . ROLE_NOT_FOUND ) ; if ( role . position === otherRole . position ) { return role . id < otherRole . id ; } return role . position > otherRole . position ; }
Checks if the first role is higher than the second role
Checks if the first role is higher than the second role
// Rare edge case handling