From fe9c201eb5587d08293f89c357fa445e09c614b4 Mon Sep 17 00:00:00 2001 From: Alee14 Date: Sun, 3 Dec 2017 06:59:37 -0500 Subject: Command Handler is now finished --- src/commands/uptime.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/commands/uptime.js (limited to 'src/commands/uptime.js') diff --git a/src/commands/uptime.js b/src/commands/uptime.js new file mode 100644 index 0000000..6109bd2 --- /dev/null +++ b/src/commands/uptime.js @@ -0,0 +1,19 @@ +module.exports.run = async (bot, message, args) => { + + var uptime = parseInt(client.uptime); + uptime = Math.floor(uptime / 1000); + var uptimeMinutes = Math.floor(uptime / 60); + var minutes = uptime % 60; + var hours = 0; + while (uptimeMinutes >= 60) { + hours++; + uptimeMinutes = uptimeMinutes - 60; + } + var uptimeSeconds = minutes % 60; + message.channel.send(":clock3: AleeBot has been up for " + hours + " hours, " + uptimeMinutes + " minutes, and " + uptimeSeconds + " seconds.") + +} + +module.exports.config = { + command: "uptime" +} \ No newline at end of file -- cgit v1.2.3