mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix(Collector): docs and types (#5937)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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() {}
|
||||
|
||||
Reference in New Issue
Block a user