diff --git a/src/class/Client.ts b/src/class/Client.ts index 51e5c0b..04f5244 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -9,6 +9,8 @@ export default class Client extends eris.Client { public commands: Collection; + public events: Collection; + public intervals: Collection; public util: Util; @@ -21,6 +23,7 @@ export default class Client extends eris.Client { constructor(token: string, options?: eris.ClientOptions) { super(token, options); this.commands = new Collection(); + this.events = new Collection(); this.intervals = new Collection(); this.db = { member: Member, moderation: Moderation, redirect: Redirect }; } @@ -52,6 +55,7 @@ export default class Client extends eris.Client { if (file === 'index.js') return; // eslint-disable-next-line const event = new (require(`${__dirname}/../events/${file}`).default)(this); + this.events.add(eventName, event); this.on(eventName, (...args) => event.run(...args)); this.util.signale.success(`Successfully loaded event: ${eventName}`); delete require.cache[require.resolve(`${__dirname}/../events/${file}`)];