From 91cac005d72aaab66983dc9dc72cef479b44d3ca Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Thu, 20 Jul 2023 22:17:51 +1000 Subject: [PATCH] Use Discord's builtin ordered listing --- src/commands/rank.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/rank.ts b/src/commands/rank.ts index e1c0275..ef555a5 100644 --- a/src/commands/rank.ts +++ b/src/commands/rank.ts @@ -139,7 +139,7 @@ export default { interaction.reply({embeds: [ new client.embed().setTitle('Ranking leaderboard') .setDescription(`Level System was created **${Math.floor((Date.now()-client.config.LRSstart)/1000/60/60/24)}** days ago. Since then, a total of **${allData.reduce((a, b)=>a+b.messages, 0).toLocaleString('en-US')}** messages have been sent in this server.`) - .addFields({name: 'Top users by messages sent:', value: allData.sort((a,b)=>b.messages - a.messages).slice(0,10).map((x,i)=>`\`${i+1}.\` <@${x._id}>: ${x.messages.toLocaleString('en-US')}`).join('\n')}) + .addFields({name: 'Top users by messages sent:', value: allData.sort((a,b)=>b.messages - a.messages).slice(0,10).map((x,i)=>`${i+1}. <@${x._id}>: ${x.messages.toLocaleString('en-US')}`).join('\n')}) .setImage('attachment://dailymsgs.png').setColor(client.config.embedColor) .setFooter({text: 'Graph updates daily.'}) ], files: [new client.attachmentBuilder(img.toBuffer(),{name: 'dailymsgs.png'})]})