From 282d96ea8cc8f09f57519d5f2dcdfd42b0467a20 Mon Sep 17 00:00:00 2001 From: maxjackson2 Date: Wed, 25 Oct 2023 10:56:04 -0700 Subject: [PATCH] AutoCommit: Bump Repository (Update Repository Files) --- bin/commands/InitCommand.js | 2 +- package.json | 2 +- src/client/RedactClient.ts | 2 ++ src/client/commands/CommandsManager.ts | 4 ++++ src/client/commands/RedactCommand.ts | 1 - src/client/events/EventManager.ts | 4 ++++ typings/index.d.ts | 2 ++ 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/commands/InitCommand.js b/bin/commands/InitCommand.js index b5c3fd7..004ac46 100644 --- a/bin/commands/InitCommand.js +++ b/bin/commands/InitCommand.js @@ -53,7 +53,7 @@ module.exports = () => CommandBuilder.createBuilder("init") step("Installing Required dependencies") - //InitializationTools.installRequired(); + InitializationTools.installRequired(); step("Done! Created All Files"); diff --git a/package.json b/package.json index 8b8f773..286fcf8 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "watch": "tsc --watch", "build-watch": "npm run build & npm run watch", "start": "node bin/index.js", - "publish": "npm run build" + "prepublish": "npm run build" }, "repository": { "type": "git", diff --git a/src/client/RedactClient.ts b/src/client/RedactClient.ts index 0e0bf31..02594ca 100644 --- a/src/client/RedactClient.ts +++ b/src/client/RedactClient.ts @@ -150,6 +150,8 @@ export class RedactClient { }, true); this.logger.info(`Connected to ${Color.greenBright(this.getBotUsername())} at ${Color.greenBright(new Date().toUTCString())}`); + this.logger.info(` ├── Loaded ${Color.yellow(this.getCommandsManager().getLoadedCommandsAmount())} number of commands`) + this.logger.info(` ├── Loaded ${Color.yellow(this.getEventManager().getLoadedEventsAmount())} number of events`); this.logger.info(` └── Amount of servers ${Color.yellow(this.getClient().guilds.cache.size)}`); if (this.readyEvent) diff --git a/src/client/commands/CommandsManager.ts b/src/client/commands/CommandsManager.ts index 8e1b082..e3d95c5 100644 --- a/src/client/commands/CommandsManager.ts +++ b/src/client/commands/CommandsManager.ts @@ -64,6 +64,10 @@ export class CommandsManager extends Loader { } } + public getLoadedCommandsAmount(): number { + return this.commands.size + 1; + } + public loadAndCall(commandFolderPath: string, callback: (command: RedactCommand) => void) { const commands = this.loadFrom(commandFolderPath, false); for (const command of commands) { diff --git a/src/client/commands/RedactCommand.ts b/src/client/commands/RedactCommand.ts index 00bdbe2..77ae8b7 100644 --- a/src/client/commands/RedactCommand.ts +++ b/src/client/commands/RedactCommand.ts @@ -11,7 +11,6 @@ export abstract class RedactCommand { private client?: RedactClient; private commandData: CommandData; - constructor(commandData: CommandData) { this.commandData = commandData; } diff --git a/src/client/events/EventManager.ts b/src/client/events/EventManager.ts index 8618e40..6c33db3 100644 --- a/src/client/events/EventManager.ts +++ b/src/client/events/EventManager.ts @@ -35,4 +35,8 @@ export class EventManager extends Loader { this.registerEvent(event); } } + + public getLoadedEventsAmount() { + return this.events.size + 1; + } } \ No newline at end of file diff --git a/typings/index.d.ts b/typings/index.d.ts index 7d6ac4b..e7795bf 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -42,6 +42,7 @@ export class CommandsManager extends Loader { public unregisterCommand(command: string): boolean; public loadCommands(commandFolderPath: string): void; public loadAndCall(commandFolderPath: string, callback: (command: RedactCommand) => void): void; + public getLoadedCommandsAmount(): number; } @@ -54,6 +55,7 @@ export class EventManager extends Loader { public registerEvent(event: Event): boolean; public loadEvents(eventFolderPath: string): void; public loadAndCall(eventFolderPath: string, callback: (event: Event) => void): void; + public getLoadedEventsAmount(): number; }