From 3122617fb4230202dad1b4e521e6b0d54ea9865f Mon Sep 17 00:00:00 2001 From: pokesudenk Date: Sun, 25 Feb 2018 00:48:48 -0500 Subject: new uptime args + new cures for boredom --- commands/Utility/uptime.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'commands/Utility') diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js index 63bd6a4..1d8529c 100644 --- a/commands/Utility/uptime.js +++ b/commands/Utility/uptime.js @@ -1,4 +1,4 @@ -exports.run = (bot, msg) => { +exports.run = (bot, msg, args) => { let uptime = parseInt(bot.uptime); uptime = Math.floor(uptime / 1000); let uptimeMinutes = Math.floor(uptime / 60); @@ -9,6 +9,9 @@ exports.run = (bot, msg) => { uptimeMinutes = uptimeMinutes - 60; } const uptimeSeconds = minutes % 60; + if (args === 'ms') return msg.channel.send(bot.uptime + ' ms.'); + if (args === 's') return msg.channel.send(uptimeSeconds); + if (args === 'min') return msg.channel.send(uptime / 60 + ':' + uptimeSeconds) msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); }; -- cgit v1.2.3 From 71deacc33391b223606a272ddec1e614528a22f9 Mon Sep 17 00:00:00 2001 From: pokesudenk Date: Sun, 25 Feb 2018 00:49:59 -0500 Subject: forgot ARRAYS gamers --- commands/Utility/uptime.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'commands/Utility') diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js index 1d8529c..ffe38e0 100644 --- a/commands/Utility/uptime.js +++ b/commands/Utility/uptime.js @@ -9,9 +9,9 @@ exports.run = (bot, msg, args) => { uptimeMinutes = uptimeMinutes - 60; } const uptimeSeconds = minutes % 60; - if (args === 'ms') return msg.channel.send(bot.uptime + ' ms.'); - if (args === 's') return msg.channel.send(uptimeSeconds); - if (args === 'min') return msg.channel.send(uptime / 60 + ':' + uptimeSeconds) + if (args[0] === 'ms') return msg.channel.send(bot.uptime + ' ms.'); + if (args[0] === 's') return msg.channel.send(uptimeSeconds); + if (args[0] === 'min') return msg.channel.send(uptime / 60 + ':' + uptimeSeconds); msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); }; -- cgit v1.2.3 From cadcaa95bc1311fb8f29e3538f62e61cc732b2e6 Mon Sep 17 00:00:00 2001 From: pokesudenk Date: Sun, 25 Feb 2018 00:51:10 -0500 Subject: might wanna f l o o r that --- commands/Utility/uptime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands/Utility') diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js index ffe38e0..c15cf66 100644 --- a/commands/Utility/uptime.js +++ b/commands/Utility/uptime.js @@ -11,7 +11,7 @@ exports.run = (bot, msg, args) => { const uptimeSeconds = minutes % 60; if (args[0] === 'ms') return msg.channel.send(bot.uptime + ' ms.'); if (args[0] === 's') return msg.channel.send(uptimeSeconds); - if (args[0] === 'min') return msg.channel.send(uptime / 60 + ':' + uptimeSeconds); + if (args[0] === 'min') return msg.channel.send(Math.floor(uptime / 60) + ':' + uptimeSeconds); msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); }; -- cgit v1.2.3 From abc2868a2d65df654b071a447c1a4eba77e76b2c Mon Sep 17 00:00:00 2001 From: pokesudenk Date: Sun, 25 Feb 2018 00:52:38 -0500 Subject: better formatting --- commands/Utility/uptime.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'commands/Utility') diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js index c15cf66..bc9b1fa 100644 --- a/commands/Utility/uptime.js +++ b/commands/Utility/uptime.js @@ -10,8 +10,8 @@ exports.run = (bot, msg, args) => { } const uptimeSeconds = minutes % 60; if (args[0] === 'ms') return msg.channel.send(bot.uptime + ' ms.'); - if (args[0] === 's') return msg.channel.send(uptimeSeconds); - if (args[0] === 'min') return msg.channel.send(Math.floor(uptime / 60) + ':' + uptimeSeconds); + if (args[0] === 's') return msg.channel.send(uptimeSeconds + ' seconds.'); + if (args[0] === 'min') return msg.channel.send(Math.floor(uptime / 60) + ' minutes ' + uptimeSeconds + ' seconds.'); msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); }; -- cgit v1.2.3