From 27566fcfe67a858c679885c0f2227f2a384db4e5 Mon Sep 17 00:00:00 2001 From: Assayyaad Date: Tue, 3 Sep 2024 12:00:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=D8=A7=D8=B3=D8=AA=D8=A8=D8=AF=D8=A7?= =?UTF-8?q?=D9=84=20=D8=AF=D8=A7=D9=84=D8=A9=20require=20=D8=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/class/discordBot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class/discordBot.js b/src/class/discordBot.js index b9b4ef3..3da6d1d 100644 --- a/src/class/discordBot.js +++ b/src/class/discordBot.js @@ -117,7 +117,7 @@ export class DiscordBot extends Client { const i2 = files[i].length - '.json'.length const name = files[i].substring(i1 + sep.length, i2) - const data = require(files[i]) + const data = (await import(files[i])).default if (data) { if (name === 'config') Object.assign(this.data.config, data) else this.data[name] = data @@ -231,7 +231,7 @@ export class DiscordBot extends Client { const failRecords = [] for (let i = 0; i < paths.length; i++) { - const botModule = require(paths[i]) + const botModule = (await import(paths[i])).default if (validCommand(botModule)) { const record = this.registerCommand(botModule)