mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
[wip] Fix collector documentation (again) (#1416)
* remove private on abstract methods, fix timeout type * make client readonly, add documentation to abstract methods * document implemented collector methods
This commit is contained in:
@@ -43,6 +43,12 @@ class ReactionCollector extends Collector {
|
||||
this.client.on('messageReactionAdd', this.listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming reaction for possible collection.
|
||||
* @param {MessageReaction} reaction The reaction to possibly collect.
|
||||
* @returns {?{key: Snowflake, value: MessageReaction}} Reaction data to collect.
|
||||
* @private
|
||||
*/
|
||||
handle(reaction) {
|
||||
if (reaction.message.id !== this.message.id) return null;
|
||||
return {
|
||||
@@ -51,6 +57,13 @@ class ReactionCollector extends Collector {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check after collection to see if the collector is done.
|
||||
* @param {MessageReaction} reaction The reaction that was collected.
|
||||
* @param {User} user The user that reacted.
|
||||
* @returns {?string} Reason to end the collector, if any.
|
||||
* @private
|
||||
*/
|
||||
postCheck(reaction, user) {
|
||||
this.users.set(user.id, user);
|
||||
if (this.options.max && ++this.total >= this.options.max) return 'limit';
|
||||
@@ -59,6 +72,10 @@ class ReactionCollector extends Collector {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove event listeners.
|
||||
* @private
|
||||
*/
|
||||
cleanup() {
|
||||
this.client.removeListener('messageReactionAdd', this.listener);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user