From 7de1d065dd6b282120b4df41bfc46285f978091c Mon Sep 17 00:00:00 2001 From: baz Date: Wed, 27 Dec 2023 21:33:27 +0000 Subject: [PATCH] Add extra formatting for the leaderboard --- commands/100-games/leaderboard.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/commands/100-games/leaderboard.js b/commands/100-games/leaderboard.js index 661907c..160b066 100644 --- a/commands/100-games/leaderboard.js +++ b/commands/100-games/leaderboard.js @@ -15,9 +15,16 @@ module.exports = { let desc = ''; for (let i = 0; i < leaderboard.length; i++) { - let newLine = ''; - newLine = newLine.concat((i + 1), '. \t', leaderboard[i].username, ' - ', leaderboard[i].count, ' games\n'); - desc = desc.concat(newLine); + + let newLine = String.prototype.concat('#', (i + 1), ' \t', leaderboard[i].username, ' - ', leaderboard[i].count, ' games'); + + if (i == 0) newLine = String.prototype.concat('**', newLine, '**'); + + if (leaderboard[i].username == interaction.user.username) newLine = String.prototype.concat('*', newLine, '*'); + + newLine = String.prototype.concat('\n', newLine); + + desc = String.prototype.concat(desc, newLine); } const embed = new EmbedBuilder()