mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-02 17:10:08 +00:00
fix(*Collector): always run postCheck, remove 'translatation' of message collector options (#3718)
* fix(*Collector): always run postCheck, correctly 'translate' message collector options * fix(MessageCollector): remove translation, fix postCheck conditions
This commit is contained in:
@@ -79,17 +79,17 @@ class Collector extends EventEmitter {
|
||||
*/
|
||||
_handle(...args) {
|
||||
const collect = this.handle(...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);
|
||||
|
||||
/**
|
||||
* Emitted whenever an element is collected.
|
||||
* @event Collector#collect
|
||||
* @param {*} element The element that got collected
|
||||
* @param {Collector} collector The collector
|
||||
*/
|
||||
this.emit('collect', collect.value, this);
|
||||
/**
|
||||
* Emitted whenever an element is collected.
|
||||
* @event Collector#collect
|
||||
* @param {*} element The element that got collected
|
||||
* @param {Collector} collector The collector
|
||||
*/
|
||||
this.emit('collect', collect.value, this);
|
||||
}
|
||||
|
||||
const post = this.postCheck(...args);
|
||||
if (post) this.stop(post);
|
||||
|
||||
Reference in New Issue
Block a user