From 77517f6a168b1d29aedc06b65c38b3a2f8291d6d Mon Sep 17 00:00:00 2001 From: Sophie Mondzelewski Date: Tue, 5 Jul 2022 12:29:14 -0500 Subject: [PATCH] Make info use the new external function for uptime --- commands/info.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/commands/info.js b/commands/info.js index 7abff07..1392773 100644 --- a/commands/info.js +++ b/commands/info.js @@ -1,19 +1,4 @@ -function Uptime (uptime) { - const totalSeconds = process.uptime(); - - const days = parseInt(totalSeconds / 86400); - const hours = parseInt((totalSeconds % 86400) / 3600); - const minutes = parseInt((totalSeconds % 3600) / 60); - const seconds = parseInt(totalSeconds % 60); - - const daystring = days + (days === 1 ? ' day' : ' days'); - const hourstring = hours + (hours === 1 ? ' hour' : ' hours'); - const minutestring = minutes + (minutes === 1 ? ' minute' : ' minutes'); - const secondstring = seconds + (seconds === 1 ? ' second' : ' seconds'); - - return `${daystring}**, **${hourstring}**, **${minutestring}**, **${secondstring}`; -} - +const Uptime = require('../functions/uptime.js'); const os = require('os'); const osu = require('node-os-utils'); const cpu = osu.cpu;