From 8c31c6c6a2e6b189690794efc706da51890aa77a Mon Sep 17 00:00:00 2001 From: Rodry <38259440+ImRodry@users.noreply.github.com> Date: Tue, 3 Aug 2021 19:00:48 +0100 Subject: [PATCH] feat(Collector): return a boolean on checkEnd --- src/structures/interfaces/Collector.js | 3 ++- typings/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/structures/interfaces/Collector.js b/src/structures/interfaces/Collector.js index 4742227c034b..b57dd1634848 100644 --- a/src/structures/interfaces/Collector.js +++ b/src/structures/interfaces/Collector.js @@ -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); } /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 520f5b6bc8b2..b7520fef252e 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -450,7 +450,7 @@ export abstract class Collector extends EventEmi public filter: CollectorFilter<[V, ...F]>; public readonly next: Promise; public options: CollectorOptions<[V, ...F]>; - public checkEnd(): void; + public checkEnd(): boolean; public handleCollect(...args: unknown[]): Promise; public handleDispose(...args: unknown[]): Promise; public stop(reason?: string): void;