From dd7d31c571ce9d6444638c66d3712c1ab6961039 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Fri, 14 Oct 2022 11:43:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fixed=20som?= =?UTF-8?q?e=20more=20code=20smells?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/managers/command/index.ts | 12 ++++-------- src/managers/event/index.ts | 6 +++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/managers/command/index.ts b/src/managers/command/index.ts index 10e6184..1816c8f 100644 --- a/src/managers/command/index.ts +++ b/src/managers/command/index.ts @@ -34,7 +34,7 @@ export const register = async (client: Client) => { }; // Send log message when it's done loading commands - const doneImporting = async () => { + const doneImporting = () => { if (importedCommandAmount !== amountOfCommands) { return logger.warn( `📦 Failed importing ${ @@ -48,13 +48,9 @@ export const register = async (client: Client) => { // Start importing commands commandNames.forEach(async (commandName: string, index: number) => { - await importCommand(commandName) - .then(async () => { - logger.debug(`📦 Imported the "${commandName}" command`); - }) - .catch(async (err) => { - logger.error(err); - }); + await importCommand(commandName).then(() => { + logger.debug(`📦 Imported the "${commandName}" command`); + }); // If done importing if (index + 1 === amountOfCommands) { diff --git a/src/managers/event/index.ts b/src/managers/event/index.ts index 3834687..cf44860 100644 --- a/src/managers/event/index.ts +++ b/src/managers/event/index.ts @@ -29,7 +29,7 @@ export const register = async (client: Client) => { // Register event const eventExecutor = async (...args: Promise[]) => { - await event.execute(...args).catch(async (err) => { + await event.execute(...args).catch((err) => { logger.error(`${err}`); }); }; @@ -52,7 +52,7 @@ export const register = async (client: Client) => { }; // Send log message when it's done loading events - const doneImporting = async () => { + const doneImporting = () => { if (importedEventAmount !== amountOfEvents) { return logger.warn( `📦 Failed importing ${ @@ -65,7 +65,7 @@ export const register = async (client: Client) => { }; eventNames.forEach(async (eventName: string, index: number) => { - await importEvent(eventName).then(async () => { + await importEvent(eventName).then(() => { logger.debug(`📦 Imported the "${eventName}" event`); });