From c526423607cdc3fb57f6a536b50d17b019672fbe Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Thu, 2 Dec 2021 15:28:36 +0000 Subject: [PATCH] Fix issue where event files existing would crash the bot --- src/client/util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/util.ts b/src/client/util.ts index 428976e..55d7410 100644 --- a/src/client/util.ts +++ b/src/client/util.ts @@ -95,11 +95,11 @@ export class Util { for (let i = 0; i < eventFiles.length; i++) { if (eventFiles[i].includes('.ts')) { - const eventName = eventFiles[i].split('.')[0]; + const eventName = eventFiles[i].split('.')[0]; - const file = require(`${process.cwd()}/${folder}/${eventName}.ts`); + const file = require(`${process.cwd()}/${folder}/${eventName}.ts`).default; - const event = new file[eventName]() as Event; + const event = new file() as Event; // Load events client.on('channelCreate', event.channelCreate); -- 2.45.2