would help if we'd actually inst the client
parent
308320e28e
commit
72e9750d2d
|
@ -58,7 +58,8 @@ export default class Client extends Eris.Client {
|
||||||
public loadCommand(commandPath: string) {
|
public loadCommand(commandPath: string) {
|
||||||
// eslint-disable-next-line no-useless-catch
|
// eslint-disable-next-line no-useless-catch
|
||||||
try {
|
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.commands.set(command.name, command);
|
||||||
this.signale.complete(`Loaded command ${command.name}`);
|
this.signale.complete(`Loaded command ${command.name}`);
|
||||||
} catch (err) { throw err; }
|
} catch (err) { throw err; }
|
||||||
|
@ -74,7 +75,9 @@ export default class Client extends Eris.Client {
|
||||||
|
|
||||||
evtFiles.forEach((file) => {
|
evtFiles.forEach((file) => {
|
||||||
const eventName = file.split('.')[0];
|
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.signale.complete(`Loaded event ${eventName}`);
|
||||||
this.on(eventName, (...args) => event.run(...args));
|
this.on(eventName, (...args) => event.run(...args));
|
||||||
delete require.cache[require.resolve(`./events/${file}`)];
|
delete require.cache[require.resolve(`./events/${file}`)];
|
||||||
|
|
Loading…
Reference in New Issue