From 0aaa6166af6ff17f9b643997fccb44de1b57b1e5 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 6 Aug 2022 21:07:39 -0400 Subject: track the number of guilds the bot is in so I can make a graph --- src/lib/extensions/discord-akairo/BushClient.ts | 81 ++++++++++++++----------- 1 file changed, 46 insertions(+), 35 deletions(-) (limited to 'src/lib/extensions/discord-akairo/BushClient.ts') diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 286d9cf..44c995a 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -58,6 +58,7 @@ import { ModLog } from '../../models/instance/ModLog.js'; import { Reminder } from '../../models/instance/Reminder.js'; import { StickyRole } from '../../models/instance/StickyRole.js'; import { Global } from '../../models/shared/Global.js'; +import { GuildCount } from '../../models/shared/GuildCount.js'; import { MemberCount } from '../../models/shared/MemberCount.js'; import { Shared } from '../../models/shared/Shared.js'; import { Stat } from '../../models/shared/Stat.js'; @@ -78,41 +79,41 @@ const { Sequelize } = (await import('sequelize')).default; declare module 'discord.js' { export interface Client extends EventEmitter { /** The ID of the owner(s). */ - ownerID: Snowflake | Snowflake[]; + readonly ownerID: Snowflake | Snowflake[]; /** The ID of the superUser(s). */ - superUserID: Snowflake | Snowflake[]; + readonly superUserID: Snowflake | Snowflake[]; /** Whether or not the client is ready. */ - customReady: boolean; + readonly customReady: boolean; /** The configuration for the client. */ - config: Config; + readonly config: Config; /** Stats for the client. */ - stats: BushStats; + readonly stats: BushStats; /** The handler for the bot's listeners. */ - listenerHandler: BushListenerHandler; + readonly listenerHandler: BushListenerHandler; /** The handler for the bot's command inhibitors. */ - inhibitorHandler: BushInhibitorHandler; + readonly inhibitorHandler: BushInhibitorHandler; /** The handler for the bot's commands. */ - commandHandler: BushCommandHandler; + readonly commandHandler: BushCommandHandler; /** The handler for the bot's tasks. */ - taskHandler: BushTaskHandler; + readonly taskHandler: BushTaskHandler; /** The handler for the bot's context menu commands. */ - contextMenuCommandHandler: ContextMenuCommandHandler; + readonly contextMenuCommandHandler: ContextMenuCommandHandler; /** The database connection for this instance of the bot (production, beta, or development). */ - instanceDB: SequelizeType; + readonly instanceDB: SequelizeType; /** The database connection that is shared between all instances of the bot. */ - sharedDB: SequelizeType; + readonly sharedDB: SequelizeType; /** A custom logging system for the bot. */ - logger: BushLogger; + readonly logger: BushLogger; /** Cached global and guild database data. */ - cache: BushCache; + readonly cache: BushCache; /** Sentry error reporting for the bot. */ - sentry: typeof Sentry; + readonly sentry: typeof Sentry; /** Manages most aspects of the highlight command */ - highlightManager: HighlightManager; + readonly highlightManager: HighlightManager; /** The perspective api */ perspective: any; /** Client utilities. */ - utils: BushClientUtils; + readonly utils: BushClientUtils; /** A custom logging system for the bot. */ get console(): BushLogger; on(event: K, listener: (...args: BushClientEvents[K]) => Awaitable): this; @@ -151,8 +152,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * The main hub for interacting with the Discord API. */ export class BushClient extends AkairoClient { - public declare ownerID: Snowflake[]; - public declare superUserID: Snowflake[]; + public declare readonly ownerID: Snowflake[]; + public declare readonly superUserID: Snowflake[]; /** * Whether or not the client is ready. @@ -162,62 +163,62 @@ export class BushClient extends AkairoClient extends AkairoClient extends AkairoClient extends AkairoClient extends AkairoClient>.`, false); } catch (e) { @@ -542,6 +550,9 @@ export interface BushClient extends EventEmitte removeAllListeners(event?: K): this; } +/** + * Various statistics + */ export interface BushStats { /** * The average cpu usage of the bot from the past 60 seconds. -- cgit