Collects reactions on messages. Will automatically stop if the message ( or ), channel (), thread (), or guild () is deleted.
Extends
Collector<Snowflake | string, MessageReaction, [User]>Name | Type | Optional | Description |
---|---|---|---|
message | Message | No | None |
options | ReactionCollectorOptions | Yes | None |
Emitted whenever a reaction is collected.
Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The reaction that was collected |
user | User | No | The user that added the reaction |
Emitted whenever a reaction is newly created on a message. Will emit only when a new reaction is added to the message, as opposed to which will be emitted even when a reaction has already been added to the message.
Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The reaction that was added |
user | User | No | The user that added the reaction |
Emitted when the reaction had all the users removed and the
dispose
option is set to true.Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The reaction that was disposed of |
user | User | No | The user that removed the reaction |
Emitted when the collector is finished collecting.
Name | Type | Optional | Description |
---|---|---|---|
collected | Collection | No | The elements collected by the collector |
reason | string | No | The reason the collector ended |
Emitted whenever an element is not collected by the collector.
Name | Type | Optional | Description |
---|---|---|---|
args | * | No | The arguments emitted by the listener |
Emitted when the reaction had one user removed and the
dispose
option is set to true.Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The reaction that was removed |
user | User | No | The user that removed the reaction |
The items collected by this collector
Inherited from CollectorWhether this collector has finished collecting
Inherited from CollectorThe reason this collector has ended with, or null if it hasn't ended yet
Inherited from CollectorThe filter applied to this collector
Inherited from CollectorThe Date at which this collector last collected an item
Inherited from CollectorThe timestamp at which this collector last collected an item
Inherited from CollectorInherited from Collector
Returns a promise that resolves with the next collected element; rejects with collected elements if the collector finishes without receiving a next element
Inherited from CollectorChecks whether the collector should end, and if so, ends it.
Inherited from CollectorReturns
Whether the collector ended or notHandles an incoming reaction for possible collection.
Returns
Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The reaction to possibly collect |
user | User | No | The user that added the reaction |
Handles a reaction deletion for possible disposal.
Returns
Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The reaction to possibly dispose of |
user | User | No | The user that removed the reaction |
Empties this reaction collector.
Call this to handle an event as a collectable element. Accepts any event data as parameters.
Name | Type | Optional | Description |
---|---|---|---|
...args | unknown[] | No | The arguments emitted by the listener |
Call this to remove an element from the collection. Accepts any event data as parameters.
Name | Type | Optional | Description |
---|---|---|---|
...args | unknown[] | No | The arguments emitted by the listener |
Gets the collector key for a reaction.
Name | Type | Optional | Description |
---|---|---|---|
reaction | MessageReaction | No | The message reaction to get the key for |
Name | Type | Optional | Description |
---|---|---|---|
event | 'collect' | 'dispose' | 'remove' | 'ignore' | No | None |
listener | (reaction: MessageReaction, user: User) => void | No | None |
Name | Type | Optional | Description |
---|---|---|---|
event | 'collect' | 'dispose' | 'remove' | 'ignore' | No | None |
listener | (reaction: MessageReaction, user: User) => void | No | None |
Resets the collector's timeout and idle timer.
Name | Type | Optional | Description |
---|---|---|---|
options | CollectorResetTimerOptions | Yes | Options for resetting |
Stops this collector and emits the
end
event.Name | Type | Optional | Description |
---|---|---|---|
reason | string | Yes | The reason this collector is ending |