From 97a36c0f24c39b707576c2aa097a38effd082214 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Mon, 22 Jul 2024 18:45:21 +0100 Subject: [PATCH] Fix list not being sorted --- src/commands/allbalance.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/allbalance.ts b/src/commands/allbalance.ts index 7db050a..0874e54 100644 --- a/src/commands/allbalance.ts +++ b/src/commands/allbalance.ts @@ -16,7 +16,8 @@ export default class AllBalance extends Command { public override async execute(interaction: CommandInteraction) { 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() .setColor(EmbedColours.Ok)