From 9967d8b1a69b34582a88cf0e583dc7f61f55b872 Mon Sep 17 00:00:00 2001 From: Kkkermit Date: Mon, 24 Jun 2024 00:07:36 +0100 Subject: [PATCH] update: Update uptime format for botinfo command --- src/triggers/mentionBot.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/triggers/mentionBot.js b/src/triggers/mentionBot.js index 2c117cf..7b44f54 100644 --- a/src/triggers/mentionBot.js +++ b/src/triggers/mentionBot.js @@ -10,6 +10,17 @@ module.exports = { const fetchGuildPrefix = await guildSettingsSchema.findOne({ Guild: message.guild.id }); const guildPrefix = fetchGuildPrefix.Prefix; + + let totalSeconds = (client.uptime / 1000); + let days = Math.floor(totalSeconds / 86400); + totalSeconds %= 86400; + let hours = Math.floor(totalSeconds / 3600); + totalSeconds %= 3600; + let minutes = Math.floor(totalSeconds / 60); + let seconds = Math.floor(totalSeconds % 60); + + let uptime = `${days}d ${hours}h ${minutes}m ${seconds}s`; + const pingEmbed = new EmbedBuilder() .setColor("Purple") @@ -20,7 +31,7 @@ module.exports = { .addFields({ name: `**👥 • Users:**`, value: `${client.guilds.cache.reduce((a,b) => a+b.memberCount, 0)}`, inline: true}) .addFields({ name: `**💣 • Commands:**`, value: `\`\`${client.commands.size}\`\` **Slash** & \`\`${client.pcommands.size}\`\` **Prefix**`, inline: true}) .addFields({ name: `**📡 • Latency:**`, value: `\`\`${Math.round(client.ws.ping)}ms\`\``, inline: true}) - .addFields({ name: `**🕒 • Uptime:**`, value: `\`\`${client.uptime}\`\``, inline: true}) + .addFields({ name: `**🕒 • Uptime:**`, value: `\`\`${uptime}\`\``, inline: true}) .addFields({ name: `**🛎️ • Prefix:**`, value: `Server prefix is \`\`${guildPrefix}\`\``, inline: true}) .setTimestamp() .setThumbnail(client.user.avatarURL())