fix(Collector): docs and types (#5937)

This commit is contained in:
Jan
2021-06-29 01:37:45 +02:00
committed by GitHub
parent 41f718f779
commit 6c447b12e3
4 changed files with 17 additions and 17 deletions

View File

@@ -82,7 +82,7 @@ class MessageComponentInteractionCollector extends Collector {
/**
* Handles an incoming interaction for possible collection.
* @param {Interaction} interaction The interaction to possibly collect
* @returns {?(Snowflake|string)}
* @returns {?Snowflake}
* @private
*/
collect(interaction) {

View File

@@ -81,7 +81,7 @@ class ReactionCollector extends Collector {
* Handles an incoming reaction for possible collection.
* @param {MessageReaction} reaction The reaction to possibly collect
* @param {User} user The user that added the reaction
* @returns {Promise<Snowflake|string>}
* @returns {Promise<?(Snowflake|string)>}
* @private
*/
async collect(reaction, user) {

View File

@@ -95,7 +95,7 @@ class Collector extends EventEmitter {
* @emits Collector#collect
*/
async handleCollect(...args) {
const collect = this.collect(...args);
const collect = await this.collect(...args);
if (collect && (await this.filter(...args, this.collected))) {
this.collected.set(collect, args[0]);
@@ -269,7 +269,7 @@ class Collector extends EventEmitter {
* be collected, or returns an object describing the data that should be stored.
* @see Collector#handleCollect
* @param {...*} args Any args the event listener emits
* @returns {?{key, value}} Data to insert into collection, if any
* @returns {?(*|Promise<?*>)} Data to insert into collection, if any
* @abstract
*/
collect() {}