From 31a8fedf2d3fc7feaad5802cae853b833c940026 Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:57:02 +0300 Subject: [PATCH] It actually didnt work so I'm just switching to require() --- package.json | 3 +-- src/Client.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cf20c19..67e195d 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "linkup-bot-lib", - "version": "1.2.1", + "version": "1.2.2", "main": "lib/Client.js", "types": "lib/*.ts", - "type": "module", "scripts": { "prepublishOnly": "typedoc", "build": "typedoc" diff --git a/src/Client.ts b/src/Client.ts index 4feadf9..350e074 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -377,7 +377,7 @@ export class Client extends TypedEventEmitter { const commands = await promisify(glob)(normalize(path + "/**/*.{ts,js}")); for (const commandPath of commands) { try { - let command: MaybeCommand = await import(commandPath); + let command: MaybeCommand = await require(commandPath); if ('default' in command) command = command.default; if (command.constructor.name === 'Object') command = Object.values(command)[0];