diff --git a/src/structures/MessageCollector.js b/src/structures/MessageCollector.js index 48234d4a4..375bc845a 100644 --- a/src/structures/MessageCollector.js +++ b/src/structures/MessageCollector.js @@ -24,6 +24,7 @@ class MessageCollector extends EventEmitter { * @typedef {Object} CollectorOptions * @property {number} [time] Duration for the collector in milliseconds * @property {number} [max] Maximum number of messages to handle + * @property {number} [maxMatches] Maximum number of successfully filtered messages to obtain */ /** @@ -86,7 +87,8 @@ class MessageCollector extends EventEmitter { * @event MessageCollector#message */ this.emit('message', message, this); - if (this.options.max && this.collected.size === this.options.max) this.stop('limit'); + if (this.collected.size >= this.options.maxMatches) this.stop('matchesLimit'); + else if (this.options.max && this.collected.size === this.options.max) this.stop('limit'); return true; } return false;