From 632581c9f7f5c703582bfbd426a162cf3e7917e1 Mon Sep 17 00:00:00 2001 From: sarah Date: Sun, 22 Mar 2026 17:09:11 +0100 Subject: [PATCH] Fix: Load both .ts and .js files for commands/events Update file filters to accept both .ts and .js files, so the bot works both in development (with ts-node) and production (compiled). Co-Authored-By: Claude Opus 4.6 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 91622de..afb40d7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ const commandFolders = readdirSync(commandsPath); for (const folder of commandFolders) { const folderPath = join(commandsPath, folder); - const commandFiles = readdirSync(folderPath).filter(file => file.endsWith('.ts')); + const commandFiles = readdirSync(folderPath).filter(file => file.endsWith('.ts') || file.endsWith('.js')); for (const file of commandFiles) { const filePath = join(folderPath, file); @@ -41,7 +41,7 @@ for (const folder of commandFolders) { // Load Events const eventsPath = join(__dirname, 'events'); -const eventFiles = readdirSync(eventsPath).filter(file => file.endsWith('.ts')); +const eventFiles = readdirSync(eventsPath).filter(file => file.endsWith('.ts') || file.endsWith('.js')); for (const file of eventFiles) { const filePath = join(eventsPath, file);