aboutsummaryrefslogtreecommitdiff
path: root/src/commands/uptime.js
blob: 99f9f50fac1a1b5d08d84e37192f318e5a7100bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module.exports.run = async (client, message, args) => {

    var uptime = parseInt(client.uptime);
        uptime = Math.floor(uptime / 1000);
        var uptimeMinutes = Math.floor(uptime / 60);
	    var minutes = uptime % 60;
		var hours = 0;
		while (uptimeMinutes >= 60) {
			hours++;
			uptimeMinutes = uptimeMinutes - 60;
		}
		var uptimeSeconds = minutes % 60;
    message.channel.send(":clock3: AleeBot has been up for " + hours + " hours, " + uptimeMinutes + " minutes, and " + uptimeSeconds + " seconds.")

}

module.exports.config = {
    command: "uptime"
}