mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
Fix Collector bug where checkEnd is only called on a valid message (#2186)
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user