diff --git a/src/structures/interfaces/Collector.js b/src/structures/interfaces/Collector.js index 21d01ca4b..969b3d2c3 100644 --- a/src/structures/interfaces/Collector.js +++ b/src/structures/interfaces/Collector.js @@ -9,7 +9,7 @@ const Util = require('../../util/Util'); * @typedef {Function} CollectorFilter * @param {...*} args Any arguments received by the listener * @param {Collection} collection The items collected by this collector - * @returns {boolean} + * @returns {boolean|Promise} */ /** @@ -86,10 +86,10 @@ class Collector extends EventEmitter { * @param {...*} args The arguments emitted by the listener * @emits Collector#collect */ - handleCollect(...args) { + async handleCollect(...args) { const collect = this.collect(...args); - if (collect && this.filter(...args, this.collected)) { + if (collect && (await this.filter(...args, this.collected))) { this.collected.set(collect, args[0]); /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 965d0dd8b..40248b0b9 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2295,7 +2295,7 @@ declare module 'discord.js' { target: WebSocket; } - type CollectorFilter = (...args: any[]) => boolean; + type CollectorFilter = (...args: any[]) => boolean | Promise; interface CollectorOptions { time?: number;