Abstract Manages the stats of your discord bot.
The options for the stats manager.
Private _statsReturns the enabled stats modules.
Private _initAdd custom module to your stats manager.
const customModule = new StatsModule("custom", { graphType: GraphType.LINE, dataType: "number" });
statsManager.addModules([customModule]);
statsManager.findModule("custom"); // => customModule
If the module is already added.
If the module has not a valid graph type.
If the module has not a valid data type.
The stats module to add.
Abstract deleteReturns the targetted stats module.
The name of the stats module.
Abstract getGets the stats.
Abstract saveSaves the stats.
The stats to save.
Acquires the stats.
statsManager.start(async () => {
return {
ram: Math.round((process.memoryUsage().heapUsed / 1024 / 1024) * 100) / 100,
servers: client.guilds.size,
users: client.users.size,
}
});
If the stats are not acquired.
If the stats are not acquired in the correct format.
The function that returns the stats.
Generated using TypeDoc
Creates a new StatsManager instance