From b2adab3ec8152c6ddd4d6a130e463f0cd8d85e43 Mon Sep 17 00:00:00 2001 From: baz Date: Wed, 27 Dec 2023 20:49:01 +0000 Subject: [PATCH] Alter game sorting in gameDetails command --- commands/100-games/gameDetails.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/commands/100-games/gameDetails.js b/commands/100-games/gameDetails.js index 30afcdd..debb297 100644 --- a/commands/100-games/gameDetails.js +++ b/commands/100-games/gameDetails.js @@ -30,9 +30,7 @@ module.exports = { if (!games[0]) return interaction.followUp('No game found.'); - await games.sort((a, b) => { - return (a.total_rating_count == null) - (b.total_rating_count == null) || +(a.total_rating_count > b.total_rating_count) || -(a.total_rating_count < b.total_rating_count); - }); + await games.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count)); const game = games[0];