Skip to content
Snippets Groups Projects
Commit 1998d810 authored by Reviath's avatar Reviath
Browse files

Added stats command.

parent 73b91682
No related branches found
No related tags found
No related merge requests found
const Discord = require("discord.js");
const moment = require("moment");
const os = require('os');
const config = require('../config.json');
const errors = require('../errors.json');
require("moment-duration-format");
exports.run = async (client, message, args) => {
const uptime = moment.duration(client.uptime).format(" D [Day], H [Hour], m [Minute], s [Second]");
var totalmem = os.totalmem()/1024/1024/1000;
var tmem = Math.floor(totalmem);
const embed = new Discord.MessageEmbed()
.setColor('RANDOM')
.addField("Author", `<@!${config.owner}>`)
.addField("Memory Usage", `\`\`\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MiB / ${tmem} GiB\`\`\``, true)
.addField("Uptime", `\`\`\`${uptime}\`\`\``)
.addField("Guilds", `\`\`\`${client.guilds.cache.size}\`\`\``, true)
.addField("Users", `\`\`\`${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}\`\`\``)
.addField("Channels", `\`\`\`${client.channels.cache.size}\`\`\``, true)
.addField("Discord.JS Version", `\`\`\`v${Discord.version}\`\`\``, true)
.addField("Node.JS Version", `\`\`\`${process.version}\`\`\``, true)
.addField("Ping", `\`\`\`${client.ws.ping}ms\`\`\``, true)
.addField("CPU", `\`\`\`\n${os.cpus().map(i => `${i.model}`)[0]}\`\`\``)
.addField("Bit", `\`\`\`${os.arch()}\`\`\``, true)
.addField("OS Platform", `\`\`\`${os.platform()}\`\`\``)
message.channel.send(embed).catch(e => {
message.channel.send(errors.cannot_send_embed).catch(e => {
return;
});
});
};
module.exports.help = {
name: 'stats',
aliases: []
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment