summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app.js b/app.js
index 76176dd..d1903a3 100644
--- a/app.js
+++ b/app.js
@@ -23,6 +23,10 @@ bot.on('error', console.error);
bot.on('message', async msg => {
//if (msg.channel.name === 'bots' || msg.channel.name === 'bot-commands' || msg.member.hasPermission('KICK_MEMBERS')) {
+ const upTime = require('moment');
+ require('moment-duration-format');
+ const duration = upTime.duration(bot.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
+
var msgContent = msg.content.toLowerCase();
if (prefixCheck()) {
console.log(msg.member.user.tag, 'says', msgContent, 'in #' + msg.channel.name);
@@ -114,6 +118,11 @@ bot.on('message', async msg => {
//return;
}
+ // Small command which need variables
+ if (command == 'uptime') {
+ msg.reply(duration);
+ }
+
// Reacts with ping emoji when @everyone
if (msg.mentions.everyone) {
msg.react(':ArisaPing:695887537390223402');