Add total count to /leaderboard

This commit is contained in:
baz 2024-04-20 16:24:37 +01:00
parent 85b0f549cd
commit 24f437bedc
1 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,17 @@ module.exports = {
await leaderboard.sort((a, b) => parseInt(b.count) - parseInt(a.count));
let desc = '';
let count = 0;
for (let i = 0; i < leaderboard.length; i++) {
if (leaderboard[i].count > 0) {
count += leaderboard[i].count;
}
}
desc = desc.concat('__Total: ', count, '__');
for (let i = 0; i < leaderboard.length; i++) {
if (leaderboard[i].count > 0) {