summaryrefslogtreecommitdiff
path: root/commands/utility/uptime.js
blob: 1fe86e976b43fff3118fa6afbab7753f1c5ae9e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const { Command } = require('discord.js-commando');
const upTime = require('moment');
require('moment-duration-format');

module.exports = class UptimeUtility extends Command {
    constructor(client) {
        super(client, {
            name: 'uptime',
            aliases: ['ut'],
            group: 'utility',
            memberName: 'uptime',
            description: 'tells you how long the bot has been online',
            throttling: {
                usages: 5,
                duration: 30
            },
            guildOnly: true
        });
    }
    run(msg) {
        const duration = upTime.duration(this.client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
        msg.reply(duration);
    }
};