diff --git a/commands/afficher-lies.js b/commands/afficher-lies.js deleted file mode 100644 index 5da0d96..0000000 --- a/commands/afficher-lies.js +++ /dev/null @@ -1,35 +0,0 @@ -const { EmbedBuilder } = require('discord.js'); -const { getAllLinks } = require('../database.js'); - -module.exports = { - data: { - name: 'afficher-lies', - description: 'Affiche la liste des comptes liés', - }, - async execute(interaction) { - const links = await getAllLinks(); - - if (!links || links.length === 0) { - return interaction.reply({ - content: 'Aucun compte lié trouvé.', - ephemeral: true - }); - } - - const embed = new EmbedBuilder() - .setColor('#00FF00') - .setTitle('👥 Liste des comptes liés') - .setDescription(links.map((link, index) => { - const lastConn = link.lastConnection - ? `📅 Dernière connexion: ` - : '📅 Dernière connexion: Jamais vu'; - - return `**${index + 1}.** <@${link.discordId}> ${link.discordUsername ? `(${link.discordUsername})` : ''}\n` + - `└ 🎮 **${link.palworldName}** (Steam: \`${link.steamId}\`)\n` + - `└ ${lastConn}`; - }).join('\n\n')) - .setTimestamp(); - - return interaction.reply({ embeds: [embed] }); - }, -}; \ No newline at end of file diff --git a/commands/utility/afficher-lies.js b/commands/utility/afficher-lies.js index 33291d1..a2ea9a0 100644 --- a/commands/utility/afficher-lies.js +++ b/commands/utility/afficher-lies.js @@ -35,9 +35,12 @@ module.exports = { for (const link of chunk) { const user = await interaction.client.users.fetch(link.discord_id).catch(() => null); const discordName = user ? user.globalName : link.discord_username; + const lastConn = link.lastConnection + ? `📅 Dernière connexion: ` + : '📅 Dernière connexion: Jamais vu'; embed.addFields({ name: `👤 ${discordName}`, - value: `🎮 Palworld: **${link.palworld_username}**\n🆔 Steam ID: \`${link.steam_id}\`\n🎯 Player ID: \`${link.player_id || 'N/A'}\`\n📅 Lié le: ${new Date(link.linked_at).toLocaleDateString('fr-FR')}`, + value: `🎮 Palworld: **${link.palworld_username}**\n🆔 Steam ID: \`${link.steam_id}\`\n🎯 Player ID: \`${link.player_id || 'N/A'}\`\n ${lastConn}\n📅 Lié le: ${new Date(link.linked_at).toLocaleDateString('fr-FR')}`, inline: false }); }