Port to eris-fleet

This commit is contained in:
Essem 2021-07-04 23:15:27 -05:00
parent 0af6533276
commit 299663adf8
No known key found for this signature in database
GPG key ID: 2502A99EDC3F6FB9
17 changed files with 115 additions and 231 deletions

View file

@ -1,10 +1,10 @@
const { version } = require("../../package.json");
const collections = require("../../utils/collections.js");
const Command = require("../../classes/command.js");
class InfoCommand extends Command {
async run() {
const owner = await this.ipc.fetchUser(process.env.OWNER);
const stats = await this.ipc.getStats();
return {
"embed": {
"color": 16711680,
@ -23,7 +23,7 @@ class InfoCommand extends Command {
},
{
"name": "💬 Total Servers:",
"value": collections.stats.guilds ? collections.stats.guilds : `${this.client.guilds.size} (for this cluster only)`
"value": stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`
},
{
"name": "✅ Official Server:",

View file

@ -11,7 +11,8 @@ class RestartCommand extends Command {
for (const command of collections.commands) {
await handler.unload(command);
}
this.ipc.broadcast("restart");
this.ipc.restartAllClusters();
//this.ipc.broadcast("restart");
}
static description = "Restarts me";

View file

@ -1,5 +1,4 @@
const { version } = require("../../package.json");
const collections = require("../../utils/collections.js");
const day = require("dayjs");
day.extend(require("dayjs/plugin/duration"));
const os = require("os");
@ -10,6 +9,7 @@ class StatsCommand extends Command {
const duration = day.duration(this.client.uptime).format(" D [days], H [hrs], m [mins], s [secs]");
const uptime = day.duration(process.uptime(), "seconds").format(" D [days], H [hrs], m [mins], s [secs]");
const owner = await this.ipc.fetchUser(process.env.OWNER);
const stats = await this.ipc.getStats();
return {
embed: {
"author": {
@ -24,12 +24,12 @@ class StatsCommand extends Command {
},
{
"name": "Cluster Memory Usage",
"value": `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`,
"value": `${stats.clusters[this.cluster].ram.toFixed(2)} MB`,
"inline": true
},
{
"name": "Total Memory Usage",
"value": collections.stats.totalRam ? `${collections.stats.totalRam.toFixed(2)} MB` : "Unknown",
"value": stats.totalRam ? `${stats.totalRam.toFixed(2)} MB` : "Unknown",
"inline": true
},
{
@ -66,12 +66,12 @@ class StatsCommand extends Command {
},
{
"name": "Servers",
"value": collections.stats.guilds ? collections.stats.guilds : `${this.client.guilds.size} (for this cluster only)`,
"value": stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`,
"inline": true
},
{
"name": "Users (approximation)",
"value": collections.stats.users ? collections.stats.users : `${this.client.users.size} (for this cluster only)`,
"value": stats.users ? stats.users : `${this.client.users.size} (for this cluster only)`,
"inline": true
}
]