aboutsummaryrefslogtreecommitdiff
path: root/aleebot.js
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-08-11 16:08:16 -0400
committerAlee14 <Alee14498@gmail.com>2017-08-11 16:08:16 -0400
commit4123cf8e02317466ccd08ca66b876cacbe32221a (patch)
treedec83e1b762d52292f2fe1bb8c9dfba3794bdc07 /aleebot.js
parentcc25357d66b95d7d23468257d6cd166aa1b2e3cd (diff)
downloadAleeBot-4123cf8e02317466ccd08ca66b876cacbe32221a.tar.gz
AleeBot-4123cf8e02317466ccd08ca66b876cacbe32221a.tar.bz2
AleeBot-4123cf8e02317466ccd08ca66b876cacbe32221a.zip
Adding a new command
Diffstat (limited to 'aleebot.js')
-rw-r--r--aleebot.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/aleebot.js b/aleebot.js
index e9b0341..ce566f2 100644
--- a/aleebot.js
+++ b/aleebot.js
@@ -92,6 +92,7 @@ client.on("message", function(message){
"**"+prefix+"ping** Type this command and you'll see ;).\n" +
'**'+prefix+'owner** Shows who made this bot.\n' +
'**'+prefix+'suggest** You suggest things (working progress).\n' +
+ '**'+prefix+'uptime** It tells you how long AleeBot has been on for.\n' +
'**'+prefix+'userinfo** Tells you your info about you.\n' +
'**'+prefix+'botinvite** Lets you bring AleeBot to your server.\n' +
'**'+prefix+'serverinvite** Invites you to the AleeArmy Server.\n' +
@@ -122,6 +123,46 @@ client.on("message", function(message){
message.reply('Sorry this feature is still being worked on :(');
}
+ if(command === 'uptime'){
+ var timeString; // What we'll eventually put into the message
+
+ var uptime = parseInt(client.uptime); // Get uptime in ms
+
+ uptime = Math.floor(uptime / 1000); // Convert from ms to s
+
+ var uptimeMinutes = Math.floor(uptime / 60); // Get the uptime in minutes
+
+ var minutes = uptime % 60;
+
+ var hours = 0;
+
+ while (uptimeMinutes >= 60) {
+
+ hours++;
+
+ uptimeMinutes = uptimeMinutes - 60;
+
+}
+
+
+
+if (uptimeMinutes < 10) {
+
+ timeString = hours + ":0" + uptimeMinutes // We need to add an additional 0 to the minutes
+
+} else {
+
+ timeString = hours + ":" + uptimeMinutes // We don't need to add an extra 0.
+
+}
+
+
+
+message.reply(":clock1: AleeBot has been up for " + timeString + " hours.");
+
+commandProcessed = true;
+ }
+
if(command === 'userinfo'){
var embed = new Discord.RichEmbed()
.setAuthor(message.author.username)