mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix: re-add highest property to RoleStore and GuildMemberRoleStore
closes #2302
This commit is contained in:
@@ -106,7 +106,7 @@ class GuildMemberRoleStore extends DataStore {
|
||||
* @readonly
|
||||
*/
|
||||
get highest() {
|
||||
return this.reduce((prev, role) => !prev || role.comparePositionTo(prev) > 0 ? role : prev);
|
||||
return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,6 +55,15 @@ class RoleStore extends DataStore {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The role with the highest position in the store
|
||||
* @type {Role}
|
||||
* @readonly
|
||||
*/
|
||||
get highest() {
|
||||
return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
|
||||
}
|
||||
|
||||
/**
|
||||
* Data that can be resolved to a Role object. This can be:
|
||||
* * A Role
|
||||
|
||||
Reference in New Issue
Block a user