From 72e9750d2d198c9f1ef049233154357e7fee6546 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 27 Oct 2019 20:47:45 -0400 Subject: [PATCH] would help if we'd actually inst the client --- src/Client.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Client.ts b/src/Client.ts index 499240a..2bba305 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -58,7 +58,8 @@ export default class Client extends Eris.Client { public loadCommand(commandPath: string) { // eslint-disable-next-line no-useless-catch try { - const command = new (require(commandPath))(this); + // eslint-disable-next-line + const command = new (require(commandPath).default)(this); this.commands.set(command.name, command); this.signale.complete(`Loaded command ${command.name}`); } catch (err) { throw err; } @@ -74,7 +75,9 @@ export default class Client extends Eris.Client { evtFiles.forEach((file) => { const eventName = file.split('.')[0]; - const event = new (require(`./events/${file}`))(this); + if (file === 'index.js') return; + // eslint-disable-next-line + const event = new (require(`./events/${file}`).default)(this); this.signale.complete(`Loaded event ${eventName}`); this.on(eventName, (...args) => event.run(...args)); delete require.cache[require.resolve(`./events/${file}`)];