From 437d238200a4601a57aae3ba2a4c3bd941a8cbc5 Mon Sep 17 00:00:00 2001 From: aahdrien Date: Wed, 10 Apr 2019 19:35:29 +0200 Subject: [PATCH] Add self ranking and number of tacos to 'score' command. --- bot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot.js b/bot.js index 52b6587..bf4b068 100644 --- a/bot.js +++ b/bot.js @@ -52,6 +52,10 @@ const forScore = controller => { (user, index) => `<@${user.id}> is n°${index + 1} with *${user.tacos}* tacos` ); + + const ownRank = ranked.findIndex(rankedUser => rankedUser.id === message.user.id); + sentences.unshift(`You are ranked n°${ownRank} with *${message.user.tacos} tacos*.\n`); + bot.reply(message, sentences.join("\n")); } );