aboutsummaryrefslogtreecommitdiff
path: root/commands/Utility/uptime.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/Utility/uptime.js')
-rw-r--r--commands/Utility/uptime.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js
new file mode 100644
index 0000000..63bd6a4
--- /dev/null
+++ b/commands/Utility/uptime.js
@@ -0,0 +1,24 @@
+exports.run = (bot, msg) => {
+ let uptime = parseInt(bot.uptime);
+ uptime = Math.floor(uptime / 1000);
+ let uptimeMinutes = Math.floor(uptime / 60);
+ const minutes = uptime % 60;
+ let hours = 0;
+ while (uptimeMinutes >= 60) {
+ hours++;
+ uptimeMinutes = uptimeMinutes - 60;
+ }
+ const uptimeSeconds = minutes % 60;
+ msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.');
+
+};
+
+exports.conf = {
+ aliases: [],
+ guildOnly: true,
+};
+
+exports.help = {
+ name: 'uptime',
+ description: 'Get the uptime of the bot.',
+};