mirror of
https://github.com/danbulant/discord.js
synced 2026-07-13 23:20:45 +00:00
Fix Collector bug where checkEnd is only called on a valid message (#2186)
This commit is contained in:
parent
84e4dd6a99
commit
229eb2be2d
1 changed files with 10 additions and 9 deletions
|
|
@ -76,8 +76,8 @@ class Collector extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
handleCollect(...args) {
|
handleCollect(...args) {
|
||||||
const collect = this.collect(...args);
|
const collect = this.collect(...args);
|
||||||
if (!collect || !this.filter(...args, this.collected)) return;
|
|
||||||
|
|
||||||
|
if (collect && this.filter(...args, this.collected)) {
|
||||||
this.collected.set(collect.key, collect.value);
|
this.collected.set(collect.key, collect.value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -87,6 +87,7 @@ class Collector extends EventEmitter {
|
||||||
* @param {...*} args The arguments emitted by the listener
|
* @param {...*} args The arguments emitted by the listener
|
||||||
*/
|
*/
|
||||||
this.emit('collect', collect.value, ...args);
|
this.emit('collect', collect.value, ...args);
|
||||||
|
}
|
||||||
this.checkEnd();
|
this.checkEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue