mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
refactor(Collector): make endReason a getter (#5271)
This commit is contained in:
@@ -90,12 +90,7 @@ class MessageCollector extends Collector {
|
||||
return message.channel.id === this.channel.id ? message.id : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks after un/collection to see if the collector is done.
|
||||
* @returns {?string}
|
||||
* @private
|
||||
*/
|
||||
endReason() {
|
||||
get endReason() {
|
||||
if (this.options.max && this.collected.size >= this.options.max) return 'limit';
|
||||
if (this.options.maxProcessed && this.received === this.options.maxProcessed) return 'processedLimit';
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user