From 33bcd082db19a1c26d12a451601242d731236e3e Mon Sep 17 00:00:00 2001 From: Louis Mazin Date: Wed, 28 Jan 2026 12:25:39 +0100 Subject: [PATCH] test --- commands/utility/afficher-lies.js | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/commands/utility/afficher-lies.js b/commands/utility/afficher-lies.js index 4500c94..a50ac1c 100644 --- a/commands/utility/afficher-lies.js +++ b/commands/utility/afficher-lies.js @@ -38,24 +38,10 @@ module.exports = { const discordName = user ? (user.globalName ? user.globalName : user.username) : link.discord_username; const discordMention = `<@${link.discord_id}>`; - // Calculer le temps depuis la dernière connexion - let lastConnectionText = ''; - if (link.lastConnection) { - const lastConn = new Date(link.lastConnection); - const now = new Date(); - const diffMs = now - lastConn; - const diffMinutes = Math.floor(diffMs / 60000); - const diffHours = Math.floor(diffMs / 3600000); - const diffDays = Math.floor(diffMs / 86400000); - - if (diffMinutes < 60) { - lastConnectionText = ` - ${diffMinutes}min ago`; - } else if (diffHours < 24) { - lastConnectionText = ` - ${diffHours}h ago`; - } else { - lastConnectionText = ` - ${diffDays}d ago`; - } - } + // date de la dernière connexion formatée pour affichage discord + const lastConnectionText = link.last_palworld_connection + ? `` + : 'Jamais connecté'; embed.addFields({ name: `👤 ${discordName} - 🎮 ${link.palworld_username} - ${lastConnectionText}`,