It actually didnt work so I'm just switching to require()

This commit is contained in:
MrMasrozYTLIVE 2024-07-12 22:57:02 +03:00
parent ddf4c4910a
commit 31a8fedf2d
2 changed files with 2 additions and 3 deletions

View File

@ -1,9 +1,8 @@
{ {
"name": "linkup-bot-lib", "name": "linkup-bot-lib",
"version": "1.2.1", "version": "1.2.2",
"main": "lib/Client.js", "main": "lib/Client.js",
"types": "lib/*.ts", "types": "lib/*.ts",
"type": "module",
"scripts": { "scripts": {
"prepublishOnly": "typedoc", "prepublishOnly": "typedoc",
"build": "typedoc" "build": "typedoc"

View File

@ -377,7 +377,7 @@ export class Client extends TypedEventEmitter<LinkUpEvents> {
const commands = await promisify(glob)(normalize(path + "/**/*.{ts,js}")); const commands = await promisify(glob)(normalize(path + "/**/*.{ts,js}"));
for (const commandPath of commands) { for (const commandPath of commands) {
try { try {
let command: MaybeCommand = await import(commandPath); let command: MaybeCommand = await require(commandPath);
if ('default' in command) command = command.default; if ('default' in command) command = command.default;
if (command.constructor.name === 'Object') command = Object.values(command)[0]; if (command.constructor.name === 'Object') command = Object.values(command)[0];