summaryrefslogtreecommitdiff
path: root/bot_discord.js
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-04-22 16:03:43 -0400
committerAlee <alee14498@gmail.com>2018-04-22 16:03:43 -0400
commit82c3dd07c299c0d89a0184a588056ecd63fcd910 (patch)
tree5bdc74f19cd94d590bd19f8da0ef8ed74a0b4709 /bot_discord.js
parentfaf97ae90c5244ac0baf58d879ca76adf517014d (diff)
downloadAleeBot-82c3dd07c299c0d89a0184a588056ecd63fcd910.tar.gz
AleeBot-82c3dd07c299c0d89a0184a588056ecd63fcd910.tar.bz2
AleeBot-82c3dd07c299c0d89a0184a588056ecd63fcd910.zip
Uptime for console!
Diffstat (limited to 'bot_discord.js')
-rw-r--r--bot_discord.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/bot_discord.js b/bot_discord.js
index 8eab9ef..b4cb86d 100644
--- a/bot_discord.js
+++ b/bot_discord.js
@@ -107,7 +107,7 @@ rl.on('line', function(cmd){
break;
case "broadcast":
if (!args[1]) {
- console.log('[!] Please insert the guild\'s ID.');
+ console.log('[!] Usage: broadcast [guildID] [channelID].');
} else {
let broadcast = args.join(" ").slice(48);
var guild = null;
@@ -117,11 +117,21 @@ rl.on('line', function(cmd){
if (channel != null) {
channel.send(broadcast);
}
- if (channel = null) {
- console.log ('Usage: broadcast [guildID] [channelID]')
- }
}
break;
+ case "uptime":
+ let uptime = parseInt(client.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;
+ console.log('[i] AleeBot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.');
+ break;
case "exit":
console.log('[i] AleeBot will now exit!')
process.exit(0);
@@ -131,6 +141,7 @@ rl.on('line', function(cmd){
msg += (`guilds - Shows all guilds that AleeBot's on.\n`)
msg += (`leave - Leaves a guild.\n`)
msg += (`broadcast - Broadcasts a message to a server.\n`)
+ msg += (`uptime - Shows the uptime for AleeBot.\n`)
msg += (`help - Shows this command.\n`)
msg += (`exit - Exits AleeBot.\n`)
console.log(msg);