aboutsummaryrefslogtreecommitdiff
path: root/src/commands/uptime.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/uptime.js')
-rw-r--r--src/commands/uptime.js19
1 files changed, 19 insertions, 0 deletions
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