Alter game sorting in gameDetails command

This commit is contained in:
baz 2023-12-27 20:49:01 +00:00
parent 00ced7006e
commit b2adab3ec8
1 changed files with 1 additions and 3 deletions

View File

@ -30,9 +30,7 @@ module.exports = {
if (!games[0]) return interaction.followUp('No game found.'); if (!games[0]) return interaction.followUp('No game found.');
await games.sort((a, b) => { await games.sort((a, b) => parseInt(b.total_rating_count) - parseInt(a.total_rating_count));
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);
});
const game = games[0]; const game = games[0];