diff --git a/src/class/Client.ts b/src/class/Client.ts index 256a352..8564287 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -65,11 +65,11 @@ export default class Client extends Eris.Client { } public async loadFunctions() { - const functions = await fs.readdir('../functions'); + const functions = await fs.readdir(`${__dirname}/../functions`); functions.forEach(async (func) => { if (func === 'index.ts' || func === 'index.js') return; try { - const funcRequire: Function = require(`../functions/${func}`).default; + const funcRequire: Function = require(`${__dirname}/../functions/${func}`).default; this.functions.set(func.split('.')[0], funcRequire); } catch (error) { this.signale.error(`Error occured loading ${func}`); @@ -121,11 +121,11 @@ export default class Client extends Eris.Client { this.on('ready', () => { this.signale.info(`Connected to Discord as ${this.user.username}#${this.user.discriminator}`); }); - const intervals = await fs.readdir('../intervals'); + const intervals = await fs.readdir(`${__dirname}/../intervals`); intervals.forEach((interval) => { // eslint-disable-next-line if (interval === 'index.js') return; - require(`../intervals/${interval}`).default(this); + require(`${__dirname}/../intervals/${interval}`).default(this); this.signale.complete(`Loaded interval ${interval.split('.')[0]}`); }); this.server = new Server(this, { port: this.config.port });