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] }); }, };