mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
make positions for channels and roles nicer (#1211)
* make role calculated position nicer * make channels sortable in a nice way too * stupid git web rebase editor * Update Guild.js * Update Guild.js * Update Guild.js * Update Guild.js * Update RESTMethods.js
This commit is contained in:
@@ -128,9 +128,8 @@ class Role {
|
||||
* @type {number}
|
||||
*/
|
||||
get calculatedPosition() {
|
||||
const sorted = this.guild.roles.array()
|
||||
.sort((r1, r2) => r1.position !== r2.position ? r1.position - r2.position : r1.id - r2.id);
|
||||
return sorted.indexOf(sorted.find(r => r.id === this.id));
|
||||
const sorted = this.guild._sortedRoles();
|
||||
return sorted.array().indexOf(sorted.get(this.id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user