Fix list not being sorted (#320)
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 17s

- Fix list on `/allbalance` command not being sorted by currency

#260

Reviewed-on: #320
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
Ethan Lane 2024-07-26 18:29:57 +01:00 committed by Vylpes
parent fef80709ee
commit 097b7284e6

View file

@ -16,7 +16,8 @@ export default class AllBalance extends Command {
public override async execute(interaction: CommandInteraction) { public override async execute(interaction: CommandInteraction) {
const users = await User.FetchAll(User); const users = await User.FetchAll(User);
const filteredUsers = users.filter(x => x.Currency > 0); const filteredUsers = users.filter(x => x.Currency > 0)
.sort((a, b) => b.Currency - a.Currency);
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setColor(EmbedColours.Ok) .setColor(EmbedColours.Ok)