mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 09:13:22 +00:00
Fix MessageCollector#postCheck
This commit is contained in:
parent
20a267c12f
commit
8beefe66d5
1 changed files with 3 additions and 4 deletions
|
|
@ -3,7 +3,7 @@ const Collector = require('./interfaces/Collector');
|
||||||
/**
|
/**
|
||||||
* @typedef {CollectorOptions} MessageCollectorOptions
|
* @typedef {CollectorOptions} MessageCollectorOptions
|
||||||
* @property {number} max The maximum amount of messages to process
|
* @property {number} max The maximum amount of messages to process
|
||||||
* @property {number} maxMatches The maximum amount of messages to collect
|
* @property {number} maxProcessed The maximum amount of messages to collect
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -56,9 +56,8 @@ class MessageCollector extends Collector {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
postCheck() {
|
postCheck() {
|
||||||
// Consider changing the end reasons for v12
|
if (this.collected.size >= this.options.max) return 'limit';
|
||||||
if (this.options.maxMatches && this.collected.size >= this.options.max) return 'matchesLimit';
|
else if (this.options.maxProcessed && this.received === this.options.maxProcessed) return 'processedLimit';
|
||||||
if (this.options.max && this.received >= this.options.maxProcessed) return 'limit';
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue