From 946568a23094044a2de7b7a2a77a2456ca9ff568 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 6 May 2020 19:32:20 -0400 Subject: [PATCH] add all events to Client#events Collection --- src/class/Client.ts | 4 ++++ 1 file changed, 4 insertions(+) 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}`)];