Add top tdroper

This commit is contained in:
*x1
2024-06-17 11:26:05 +02:00
parent 201d36c058
commit 66bb004c0f
2 changed files with 46 additions and 4 deletions
+27 -1
View File
@@ -51,9 +51,35 @@ module.exports = {
CadenaS = "🔐"
}
//////////////////////////////////////////////////// TEAM DROPER ///////////////////////////////////////////////////////////////////
data = await new Promise((resolve, reject) => {
db.all(`SELECT userId, teamDroper AS coins FROM users WHERE guildId = ? ORDER BY coins DESC LIMIT 10`, [message.guild.id], (err, rows) => {
if (err) reject(err);
resolve(rows);
});
});
let leaderboard = data.map((row, i) => {
let position;
switch (i) {
case 0:
position = ':first_place:';
break;
case 1:
position = ':second_place:';
break;
case 2:
position = ':third_place:';
break;
default:
position = `**${i + 1}.**`;
}
return `${position} <@${row.userId}> - \`${row.coins}\`coins donné(s)`;
}).join('\n');
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const embed = new EmbedBuilder()
.setTitle('🛡️ Informations de `' + team.name + '`:')
.setDescription(`**Id:** \`${team.id}\`\n**Description:** \`${team.description}\`\n**Banque:** \`${team.bank}\`coins\n**Niveau:** \`${team.level}\`\n**Reputation:** \`${team.reputation}\`\n\n**Soldats:** \`${team.soldiers}\`\n**Soldats blessés:** \`${team.woundedSoldiers}\`\n**Niveau du camp:** \`${team.campLevel}\`\n**Tourelles:** \`${team.turrets}\`\n**Cadenas:** \`${CadenaS}\`\n\n**Membres (\`${memberlist.length}\`):**\n${memberlist.map(member => `**${member.teamRole}:** <@${member.userId}>`).join('\n')}`)
.setDescription(`**Id:** \`${team.id}\`\n**Description:** \`${team.description}\`\n**Banque:** \`${team.bank}\`coins\n**Niveau:** \`${team.level}\`\n**Reputation:** \`${team.reputation}\`\n\n**Soldats:** \`${team.soldiers}\`\n**Soldats blessés:** \`${team.woundedSoldiers}\`\n**Niveau du camp:** \`${team.campLevel}\`\n**Tourelles:** \`${team.turrets}\`\n**Cadenas:** \`${CadenaS}\`\n\n**Membres (\`${memberlist.length}\`):**\n${memberlist.map(member => `**${member.teamRole}:** <@${member.userId}>`).join('\n')}\nLes 10 meilleurs donnateur de la team sont :\n\n${leaderboard}`)
.setColor(await embedColor(message.author.id, message.guild.id))
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() });