diff options
| author | Alee14 <Alee14498@gmail.com> | 2017-12-03 06:59:37 -0500 |
|---|---|---|
| committer | Alee14 <Alee14498@gmail.com> | 2017-12-03 06:59:37 -0500 |
| commit | fe9c201eb5587d08293f89c357fa445e09c614b4 (patch) | |
| tree | 921780dfd6a9cbe022363f09f1c2e90e52c7aed1 /src/commands/uptime.js | |
| parent | 34d5670837d8d72354c42fd4e74978767bea0416 (diff) | |
| download | AleeBot-fe9c201eb5587d08293f89c357fa445e09c614b4.tar.gz AleeBot-fe9c201eb5587d08293f89c357fa445e09c614b4.tar.bz2 AleeBot-fe9c201eb5587d08293f89c357fa445e09c614b4.zip | |
Command Handler is now finished
Diffstat (limited to 'src/commands/uptime.js')
| -rw-r--r-- | src/commands/uptime.js | 19 |
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 |
