Created
June 8, 2018 02:52
-
-
Save ItzMeDwii/d150aa7d3e920376b2de756000805799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Discord = require("discord.js") | |
const moment = require('moment'); | |
const _fs = require("fs"); | |
const packages = JSON.parse(_fs.readFileSync('./package.json', 'utf-8')); | |
require('moment-duration-format'); | |
const os = require('os'); | |
let cpu = os.cpus(); | |
exports.run = (client, message, args, tools) => { | |
const duration = moment.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]"); | |
const servers = client.guilds.size | |
const client_channel = client.guilds.reduce((a, b) => a + b.channels.size, 0).toLocaleString() | |
const owner = packages.author | |
const idowner = packages.idauthor | |
const cpu = process.cpuUsage().system / 1024 / 1024; | |
const users = client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString() | |
const nodever = process.version | |
const memory_on_bot = (process.memoryUsage().rss / 1024 / 1024).toFixed(2) | |
const embed = new Discord.RichEmbed() | |
.setColor(0xff2f2f) | |
.setDescription("📊 PUBGMID Stats") | |
.setFooter("PUBGMID | by ItzMeDwii") | |
.setTimestamp() | |
.addField("Bot Uptime:", `• ${duration}`, true) | |
.addField("Memory Usage:", `• ${memory_on_bot} MB`, true) | |
.addField("Advanced Stats:", `• ${servers} Servers \n• ${users} Users \n• ${client_channel} Channels`, true) | |
.addField("Bot Informations:", `\n• Node.js: ${packages.engines.node} \n• Bot Developer: ${owner} \n• Bot Version: ${packages.version}`, true) | |
.addField("CPU Usage:", `• ${Math.round(cpu * 100) / 100}%`, true) | |
message.channel.send({embed}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment