From 3a6139d38a0cd2a666e7fe0b4d4d708695b3e903 Mon Sep 17 00:00:00 2001 From: Marcin Czop Date: Tue, 19 Nov 2024 22:34:48 +0100 Subject: [PATCH] Fix file extensions --- src/client.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client.ts b/src/client.ts index b5189a9..6d2eb02 100644 --- a/src/client.ts +++ b/src/client.ts @@ -32,9 +32,9 @@ class Bot extends Client { this.login(process.env.TOKEN); this.log.info("Loading commands..."); - const commandFiles: string[] = await glob(`${__dirname}/commands/**/*.ts`); + const commandFiles: string[] = await glob(`${__dirname}/commands/**/*{.ts,.js}`); + console.log(commandFiles); commandFiles.map(async (fileName: string) => { - console.debug(`Registering command: ${fileName}`); const filePath = path.resolve(fileName); const file: Command = await import(filePath); this.commands.set(file.name, file); @@ -42,9 +42,8 @@ class Bot extends Client { }); this.log.info("Loading events..."); - const eventFiles: string[] = await glob(`${__dirname}/events/**/*.ts`); + const eventFiles: string[] = await glob(`${__dirname}/events/**/*{.ts,.js}`); eventFiles.map(async (fileName: string) => { - console.debug(`Registering event: ${fileName}`); const filePath = path.resolve(fileName); const file: Event = await import(filePath); this.events.set(file.name, file);