mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 21:43:33 +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) {
|
||||
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);
|
||||
|
||||
/**
|
||||
@@ -87,6 +87,7 @@ class Collector extends EventEmitter {
|
||||
* @param {...*} args The arguments emitted by the listener
|
||||
*/
|
||||
this.emit('collect', collect.value, ...args);
|
||||
}
|
||||
this.checkEnd();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user