2023-03-15 14:09:09 +00:00
|
|
|
import Command from "../../classes/command.js";
|
|
|
|
import { connections } from "../../utils/image.js";
|
|
|
|
|
|
|
|
class ImageStatsCommand extends Command {
|
2023-03-19 05:10:48 +00:00
|
|
|
static category = "general"
|
2023-03-15 14:09:09 +00:00
|
|
|
async run() {
|
2023-03-17 00:23:01 +00:00
|
|
|
// await this.acknowledge();
|
|
|
|
let desc = `The bot is currently connected to ${connections.size} image server(s).\n`
|
2023-03-15 14:09:09 +00:00
|
|
|
let i = 0;
|
|
|
|
for (const connection of connections.values()) {
|
|
|
|
const count = await connection.getCount();
|
|
|
|
if (!count) continue;
|
2023-03-17 00:23:01 +00:00
|
|
|
desc = desc + `Server ${i++}\nRunning Jobs: ${count}`
|
2023-03-15 14:09:09 +00:00
|
|
|
}
|
2023-03-17 00:23:01 +00:00
|
|
|
return desc;
|
2023-03-15 14:09:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static description = "Gets some statistics about the image servers";
|
|
|
|
static aliases = ["imgstat", "imstats", "imgstats", "imstat"];
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ImageStatsCommand;
|