From 0eb1a03479f8ca981f25294d393d89eec7e32a28 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Sat, 30 Nov 2024 14:37:00 +0200 Subject: oops --- commands.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/commands.ts b/commands.ts index e416aad..961000d 100644 --- a/commands.ts +++ b/commands.ts @@ -185,11 +185,10 @@ export function register(cmd: string, data: Command) { const commandFiles = fs .readdirSync("commands") - .filter((filename: string) => filename.endsWith(".js") || filename.endsWith(".ts")) - .map((file: string) => file.replace(/\.js$/gim, "")); + .filter((filename: string) => filename.endsWith(".js") || filename.endsWith(".ts")); for (let i = 0; i < commandFiles.length; i++) { - const cmdName = commandFiles[i]; - const cmd = (await import(`./commands/${cmdName}.js`)).default; - register(cmdName, cmd); + const cmdPath = commandFiles[i]; + const cmd = (await import(`./commands/${cmdPath}`)).default; + register(cmdPath.replace(/\.[jt]s$/gim, ""), cmd); } -- cgit 1.4.1-2-gfad0