Первое место, а не нулевое

This commit is contained in:
JonnyBro 2021-12-18 20:34:30 +05:00
parent 51fa063332
commit b094ba882c

View file

@ -27,7 +27,7 @@ class Leaderboard extends Command {
const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(), const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(),
membersLeaderboard = members.map((m) => { membersLeaderboard = members.map((m) => {
return { return {
id: m.id, id: m.id + 1,
value: m.money + m.bankSold value: m.money + m.bankSold
}; };
}).sort((a,b) => b.value - a.value); }).sort((a,b) => b.value - a.value);
@ -40,7 +40,7 @@ class Leaderboard extends Command {
const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(), const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(),
membersLeaderboard = members.map((m) => { membersLeaderboard = members.map((m) => {
return { return {
id: m.id, id: m.id + 1,
value: m.level value: m.level
}; };
}).sort((a,b) => b.value - a.value); }).sort((a,b) => b.value - a.value);
@ -53,7 +53,7 @@ class Leaderboard extends Command {
const users = await this.client.usersData.find().lean(), const users = await this.client.usersData.find().lean(),
usersLeaderboard = users.map((u) => { usersLeaderboard = users.map((u) => {
return { return {
id: u.id, id: u.id + 1,
value: u.rep value: u.rep
}; };
}).sort((a,b) => b.value - a.value); }).sort((a,b) => b.value - a.value);