Haha-Yes/commands/utility/stats.js

28 lines
973 B
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
2018-12-25 19:17:07 +01:00
2018-12-30 01:20:24 +01:00
class StatsCommand extends Command {
constructor() {
super('stats', {
aliases: ['stats'],
category: 'utility',
description: {
content: 'Show some stats about the bot',
usage: '',
examples: ['']
}
2018-09-08 16:10:28 +02:00
});
}
2018-12-30 01:20:24 +01:00
async exec(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
}
2018-12-30 01:20:24 +01:00
}
module.exports = StatsCommand;