mirror of
https://github.com/arthur-pbty/bot-discord-coins.git
synced 2026-06-03 23:36:29 +02:00
Update team.js => ajout d'un 2e embed avec le top donnateur pour pas dépasser la limite de caractère
This commit is contained in:
+19
-12
@@ -5,7 +5,7 @@ const embedColor = require('../../fonctions/embedColor.js');
|
||||
module.exports = {
|
||||
aliases: ['t', 'tinfo', 'teaminfo'],
|
||||
description: 'Affiche les informations de votre team.',
|
||||
emote: '🛡️',
|
||||
emote: '🛡️',
|
||||
utilisation: '',
|
||||
permission: 0,
|
||||
|
||||
@@ -79,22 +79,29 @@ module.exports = {
|
||||
|
||||
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')}\n\n**Les 10 meilleurs donnateur de la team sont :**\n${leaderboard}\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')}\n`)
|
||||
.setColor(await embedColor(message.author.id, message.guild.id))
|
||||
.setTimestamp()
|
||||
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() });
|
||||
|
||||
const urlRegex1 = /(https?:\/\/[^\s]+)/g;
|
||||
if (team.icon && urlRegex1.test(team.icon)) {
|
||||
embed.setThumbnail(team.icon);
|
||||
}
|
||||
|
||||
const urlRegex2 = /(https?:\/\/[^\s]+)/g;
|
||||
if (team.banner && urlRegex2.test(team.banner)) {
|
||||
embed.setImage(team.banner);
|
||||
}
|
||||
const embedTopDonnateur = new EmbedBuilder()
|
||||
.setTitle('**Les 10 meilleurs donnateurs de la team sont :**')
|
||||
.setDescription(`${leaderboard}`)
|
||||
.setColor(await embedColor(message.author.id, message.guild.id))
|
||||
.setTimestamp()
|
||||
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() });
|
||||
|
||||
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } });
|
||||
const urlRegex1 = /(https?:\/\/[^\s]+)/g;
|
||||
if (team.icon && urlRegex1.test(team.icon)) {
|
||||
embed.setThumbnail(team.icon);
|
||||
}
|
||||
|
||||
const urlRegex2 = /(https?:\/\/[^\s]+)/g;
|
||||
if (team.banner && urlRegex2.test(team.banner)) {
|
||||
embedTopDonnateur.setImage(team.banner);
|
||||
}
|
||||
|
||||
return message.reply({ embeds: [embed, embedTopDonnateur], allowedMentions: { repliedUser: false } });
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user