From cce24d05a1d565863bbddfb09a1b0880df44f1e5 Mon Sep 17 00:00:00 2001 From: Matte <51192395+MatteZ02@users.noreply.github.com> Date: Tue, 24 Dec 2019 15:21:34 +0200 Subject: [PATCH] Update status.js --- commands/status.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/commands/status.js b/commands/status.js index 14c0b2db..b192830a 100644 --- a/commands/status.js +++ b/commands/status.js @@ -5,23 +5,13 @@ module.exports = { cooldown: 5, onlyDev: false, execute(message, args, client, Discord, prefix) { - let rawUptime = client.uptime; - let uptime = {}; - uptime['d'] = rawUptime / 86400000; - uptime['h'] = rawUptime / 3600000; - uptime['m'] = rawUptime / 60000; - let finalUptime; - if (uptime.d < 1) { - finalUptime = `${Math.round(uptime.h * 10) / 10} hours`; - } else { - finalUptime = `${Math.round(uptime.d * 10) / 10} days`; - } - let ping = Math.floor(client.ping * 10) / 10; + const uptime = client.funcs.msToTime(client.uptime); + const ping = Math.floor(client.ping * 10) / 10; const embed = new Discord.RichEmbed() .setTitle(`Status for ${client.user.username}`) .addField(':signal_strength: Ping', ping, true) - .addField(':stopwatch: Uptime', finalUptime, true) + .addField(':stopwatch: Uptime', uptime, true) .addField(`:play_pause: Currently playing music on`, `${client.voiceConnections.size} guild(s)`, true) .addField(`💿 Operating system`, process.platform, true) .setAuthor(client.user.username, client.user.displayAvatarURL)