Acommodate for possible missing stats
This commit is contained in:
parent
560d3883ad
commit
4684db06e8
2 changed files with 13 additions and 13 deletions
|
@ -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
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue