mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
Pass the collection of X collected in collectors (#1594)
...to the filter function.
This commit is contained in:
parent
8b8a365e99
commit
9c2e3b8978
1 changed files with 2 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ const EventEmitter = require('events');
|
|||
* Filter to be applied to the collector.
|
||||
* @typedef {Function} CollectorFilter
|
||||
* @param {...*} args Any arguments received by the listener
|
||||
* @param {Collection} collection The items collected by this collector
|
||||
* @returns {boolean} To collect or not collect
|
||||
*/
|
||||
|
||||
|
|
@ -75,7 +76,7 @@ class Collector extends EventEmitter {
|
|||
*/
|
||||
handleCollect(...args) {
|
||||
const collect = this.collect(...args);
|
||||
if (!collect || !this.filter(...args)) return;
|
||||
if (!collect || !this.filter(...args, this.collected)) return;
|
||||
|
||||
this.collected.set(collect.key, collect.value);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue