Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
fix: fixed /guilds command slicing array before sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusbegby committed Jul 15, 2023
1 parent 18504f4 commit 7e1054d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions system-commands/guilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ module.exports = {
memberCount: guild.memberCount
};
})
.slice(0, 50)
.sort((a, b) => b.memberCount - a.memberCount)
.map((guild, index) => `${index + 1}. \`${guild.name} (#${guild.memberCount})\``)
.slice(0, 50)
.map(
(guild, index) =>
`${index + 1}. \`${guild.name} (#${guild.memberCount})\``
)
.join('\n');

let embedDescription = `**${embedIcons.bot} ${
Expand Down

0 comments on commit 7e1054d

Please # to comment.