Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(Role): calculate position correctly when rawPositions are equal (#…
  • Loading branch information
vladfrangu committed Oct 9, 2023
1 parent 5f6a82d commit 56b481b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/Role.js
Expand Up @@ -231,7 +231,7 @@ class Role extends Base {
let count = 0;
for (const role of this.guild.roles.cache.values()) {
if (this.rawPosition > role.rawPosition) count++;
else if (this.rawPosition === role.rawPosition && BigInt(this.id) > BigInt(role.id)) count++;
else if (this.rawPosition === role.rawPosition && BigInt(this.id) < BigInt(role.id)) count++;
}

return count;
Expand Down

0 comments on commit 56b481b

Please sign in to comment.