diff --git a/src/structures/MessageCollector.js b/src/structures/MessageCollector.js index d034a96db..3d9fcf727 100644 --- a/src/structures/MessageCollector.js +++ b/src/structures/MessageCollector.js @@ -37,6 +37,7 @@ class MessageCollector extends Collector { for (const message of messages.values()) this.handleDispose(message); }).bind(this); + this.client.setMaxListeners(this.client.getMaxListeners() + 1); this.client.on(Events.MESSAGE_CREATE, this.handleCollect); this.client.on(Events.MESSAGE_DELETE, this.handleDispose); this.client.on(Events.MESSAGE_BULK_DELETE, bulkDeleteListener); @@ -45,6 +46,7 @@ class MessageCollector extends Collector { this.client.removeListener(Events.MESSAGE_CREATE, this.handleCollect); this.client.removeListener(Events.MESSAGE_DELETE, this.handleDispose); this.client.removeListener(Events.MESSAGE_BULK_DELETE, bulkDeleteListener); + this.client.setMaxListeners(this.client.getMaxListeners() - 1); }); } diff --git a/src/structures/ReactionCollector.js b/src/structures/ReactionCollector.js index 27582893a..b0a2130eb 100644 --- a/src/structures/ReactionCollector.js +++ b/src/structures/ReactionCollector.js @@ -42,6 +42,7 @@ class ReactionCollector extends Collector { this.empty = this.empty.bind(this); + this.client.setMaxListeners(this.client.getMaxListeners() + 1); this.client.on(Events.MESSAGE_REACTION_ADD, this.handleCollect); this.client.on(Events.MESSAGE_REACTION_REMOVE, this.handleDispose); this.client.on(Events.MESSAGE_REACTION_REMOVE_ALL, this.empty); @@ -50,6 +51,7 @@ class ReactionCollector extends Collector { this.client.removeListener(Events.MESSAGE_REACTION_ADD, this.handleCollect); this.client.removeListener(Events.MESSAGE_REACTION_REMOVE, this.handleDispose); this.client.removeListener(Events.MESSAGE_REACTION_REMOVE_ALL, this.empty); + this.client.setMaxListeners(this.client.getMaxListeners() - 1); }); this.on('collect', (reaction, user) => {