Acommodate for possible missing stats

This commit is contained in:
Essem 2021-08-17 23:45:41 -05:00
parent 560d3883ad
commit 4684db06e8
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 13 additions and 13 deletions

View file

@ -22,12 +22,12 @@ class StatsCommand extends Command {
},
{
"name": "Cluster Memory Usage",
"value": `${stats.clusters[this.cluster].ram.toFixed(2)} MB`,
"value": stats ? `${stats.clusters[this.cluster].ram.toFixed(2)} MB` : `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`,
"inline": true
},
{
"name": "Total Memory Usage",
"value": stats.totalRam ? `${stats.totalRam.toFixed(2)} MB` : "Unknown",
"value": stats && stats.totalRam ? `${stats.totalRam.toFixed(2)} MB` : "Unknown",
"inline": true
},
{
@ -64,12 +64,12 @@ class StatsCommand extends Command {
},
{
"name": "Servers",
"value": stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`,
"value": stats && stats.guilds ? stats.guilds : `${this.client.guilds.size} (for this cluster only)`,
"inline": true
},
{
"name": "Users (approximation)",
"value": stats.users ? stats.users : `${this.client.users.size} (for this cluster only)`,
"value": stats && stats.users ? stats.users : `${this.client.users.size} (for this cluster only)`,
"inline": true
}
]

18
package-lock.json generated
View file

@ -1159,9 +1159,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.3.807",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.807.tgz",
"integrity": "sha512-p8uxxg2a23zRsvQ2uwA/OOI+O4BQxzaR7YKMIGGGQCpYmkFX2CVF5f0/hxLMV7yCr7nnJViCwHLhPfs52rIYCA==",
"version": "1.3.810",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.810.tgz",
"integrity": "sha512-NteznMlGtkIZCJNM2X6AVm3oMqWAdq7TjqagZhmVLPwd9mtrIq+rRxGHerjFAOFIqQJYQUMT72ncd/lVcH1cOw==",
"dev": true,
"peer": true
},
@ -1212,7 +1212,7 @@
},
"node_modules/eris-fleet": {
"version": "0.3.9",
"resolved": "git+ssh://git@github.com/esmBot/eris-fleet.git#29bdc8b50ab910d64ca78cbd6db751e4642b97d4",
"resolved": "git+ssh://git@github.com/esmBot/eris-fleet.git#0e9784da393c1d26b28914eb02ede9dd765f8fca",
"license": "MIT",
"peerDependencies": {
"eris": "^0.15.0"
@ -4522,9 +4522,9 @@
"integrity": "sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg=="
},
"electron-to-chromium": {
"version": "1.3.807",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.807.tgz",
"integrity": "sha512-p8uxxg2a23zRsvQ2uwA/OOI+O4BQxzaR7YKMIGGGQCpYmkFX2CVF5f0/hxLMV7yCr7nnJViCwHLhPfs52rIYCA==",
"version": "1.3.810",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.810.tgz",
"integrity": "sha512-NteznMlGtkIZCJNM2X6AVm3oMqWAdq7TjqagZhmVLPwd9mtrIq+rRxGHerjFAOFIqQJYQUMT72ncd/lVcH1cOw==",
"dev": true,
"peer": true
},
@ -4566,8 +4566,8 @@
}
},
"eris-fleet": {
"version": "git+ssh://git@github.com/esmBot/eris-fleet.git#29bdc8b50ab910d64ca78cbd6db751e4642b97d4",
"from": "eris-fleet@esmBot/eris-fleet",
"version": "git+ssh://git@github.com/esmBot/eris-fleet.git#0e9784da393c1d26b28914eb02ede9dd765f8fca",
"from": "eris-fleet@github:esmBot/eris-fleet",
"requires": {}
},
"erlpack": {