Fix: Load both .ts and .js files for commands/events
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 6s

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 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 17:09:11 +01:00
parent 6825e9d1b2
commit 632581c9f7

View File

@@ -23,7 +23,7 @@ const commandFolders = readdirSync(commandsPath);
for (const folder of commandFolders) { for (const folder of commandFolders) {
const folderPath = join(commandsPath, folder); 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) { for (const file of commandFiles) {
const filePath = join(folderPath, file); const filePath = join(folderPath, file);
@@ -41,7 +41,7 @@ for (const folder of commandFolders) {
// Load Events // Load Events
const eventsPath = join(__dirname, '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) { for (const file of eventFiles) {
const filePath = join(eventsPath, file); const filePath = join(eventsPath, file);