Haha-Yes/commands/utility/stats.js

22 lines
924 B
JavaScript
Raw Normal View History

2018-09-08 16:10:28 +02:00
const { Command } = require('discord.js-commando');
2018-10-01 16:17:33 +02:00
module.exports = class statsCommand extends Command {
2018-09-08 16:10:28 +02:00
constructor(client) {
super(client, {
name: 'stats',
2018-09-16 21:02:11 +02:00
group: 'utility',
2018-09-08 16:10:28 +02:00
memberName: 'stats',
description: 'Show bot stats.',
});
}
2018-09-09 21:32:08 +02:00
async run(message) {
2018-09-18 01:49:50 +02:00
let totalSeconds = (this.client.uptime / 1000);
2018-09-18 01:52:03 +02:00
let days = Math.floor(totalSeconds / 86400);
2018-09-18 01:49:50 +02:00
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
let seconds = totalSeconds.toFixed(0) % 60;
2018-09-18 01:52:03 +02:00
let uptime = `${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds`;
2018-09-18 01:49:50 +02:00
return message.channel.send(`Servers: \`${this.client.guilds.size}\`\nChannels: \`${this.client.channels.size}\`\nUsers: \`${this.client.users.size}\`\nBot uptime: \`${uptime}\``);
2018-09-08 16:10:28 +02:00
}
};