mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
feat(Collector): return a boolean on checkEnd (#6289)
This commit is contained in:
@@ -207,7 +207,6 @@ class Collector extends EventEmitter {
|
||||
/**
|
||||
* Resets the collector's timeout and idle timer.
|
||||
* @param {CollectorResetTimerOptions} [options] Options for reseting
|
||||
|
||||
*/
|
||||
resetTimer({ time, idle } = {}) {
|
||||
if (this._timeout) {
|
||||
@@ -222,10 +221,12 @@ class Collector extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Checks whether the collector should end, and if so, ends it.
|
||||
* @returns {boolean} Whether the collector ended or not
|
||||
*/
|
||||
checkEnd() {
|
||||
const reason = this.endReason;
|
||||
if (reason) this.stop(reason);
|
||||
return Boolean(reason);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user