diff options
author | WlodekM <[email protected]> | 2024-11-30 14:37:00 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2024-11-30 14:37:00 +0200 |
commit | 0eb1a03479f8ca981f25294d393d89eec7e32a28 (patch) | |
tree | ea86d49276c7d8e4bb5f0dd642a2f6a31b1263f9 | |
parent | 4f53004d26fb471a72cfbe523551b373e3f5ea17 (diff) |
oops
-rw-r--r-- | commands.ts | 9 |
1 files 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); } |