From 2543341d3c699dc1076059fa0e8b8bfe01957240 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Fri, 15 Aug 2025 00:08:53 -0700 Subject: [PATCH] fix: indexing --- src/commands/leaderboard.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/leaderboard.ts b/src/commands/leaderboard.ts index 9b648d6..6a02f55 100644 --- a/src/commands/leaderboard.ts +++ b/src/commands/leaderboard.ts @@ -27,14 +27,14 @@ export const leaderboard: Command = async(pavelle, interaction) => { }); const topTen = sorted.slice(0, 10).map((member, index) => { - return `- **#${index.toString()}:** <@${member.userId}> - ${member.points.toString()} point(s).`; + return `- **#${(index + 1).toString()}:** <@${member.userId}> - ${member.points.toString()} point(s).`; }). join("\n"); const yourScore = sorted.find((member) => { return member.userId === interaction.member.id; }); const yourRank = yourScore - ? `You are rank #${sorted.indexOf(yourScore).toString()} with ${yourScore.points.toString()} points.` + ? `You are rank #${(sorted.indexOf(yourScore) + 1).toString()} with ${yourScore.points.toString()} points.` : "You are not ranked. Try throwing some stuff!"; await interaction.editReply({ allowedMentions: {