ReactionCollector

export class ReactionCollector extends Collector<Snowflake | string, MessageReaction, [User]>
export class ReactionCollector extends Collector<Snowflake | string, MessageReaction, [User]>
Collects reactions on messages. Will automatically stop if the message ( or ), channel (), thread (), or guild () is deleted.
constructor(message, options?)
NameTypeOptionalDescription
messageMessageNoNone
optionsReactionCollectorOptionsYesNone
collect(reaction, user)
Emitted whenever a reaction is collected.
NameTypeOptionalDescription
reactionMessageReactionNoThe reaction that was collected
userUserNoThe user that added the reaction
create(reaction, user)
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.
NameTypeOptionalDescription
reactionMessageReactionNoThe reaction that was added
userUserNoThe user that added the reaction
dispose(reaction, user)
Emitted when the reaction had all the users removed and the dispose option is set to true.
NameTypeOptionalDescription
reactionMessageReactionNoThe reaction that was disposed of
userUserNoThe user that removed the reaction
end(collected, reason)
Emitted when the collector is finished collecting.
NameTypeOptionalDescription
collectedCollectionNoThe elements collected by the collector
reasonstringNoThe reason the collector ended
ignore(args)
Emitted whenever an element is not collected by the collector.
NameTypeOptionalDescription
args*NoThe arguments emitted by the listener
remove(reaction, user)
Emitted when the reaction had one user removed and the dispose option is set to true.
NameTypeOptionalDescription
reactionMessageReactionNoThe reaction that was removed
userUserNoThe user that removed the reaction
Readonly
client:Client
The client that instantiated this Collector
Inherited from Collector
collected:Collection<K, V>
The items collected by this collector
Inherited from Collector
ended:boolean
Whether this collector has finished collecting
Inherited from Collector
Readonly
endReason:string | null
The reason this collector has ended with, or null if it hasn't ended yet
Inherited from Collector
filter:CollectorFilter<[V, ...F]>
The filter applied to this collector
Inherited from Collector
Readonly
lastCollectedAt:Date | null
The Date at which this collector last collected an item
Inherited from Collector
lastCollectedTimestamp:number | null
The timestamp at which this collector last collected an item
Inherited from Collector
Protected
listener:(...args: any[]) => void
Inherited from Collector
message:Message
The message upon which to collect reactions
The options of this collector
total:number
The total number of reactions collected
The users that have reacted to this message
[Symbol.asyncIterator]():AsyncIterableIterator<[V, ...F]>
checkEnd():boolean
Checks whether the collector should end, and if so, ends it.
Returns
Whether the collector ended or not
Inherited from Collector
collect(reaction, user):Snowflake | string | null
Handles an incoming reaction for possible collection.
Returns
NameTypeOptionalDescription
reactionMessageReactionNoThe reaction to possibly collect
userUserNoThe user that added the reaction
dispose(reaction, user):Snowflake | string | null
Handles a reaction deletion for possible disposal.
Returns
NameTypeOptionalDescription
reactionMessageReactionNoThe reaction to possibly dispose of
userUserNoThe user that removed the reaction
empty():void
Empties this reaction collector.
handleCollect(...args):Promise<void>
Call this to handle an event as a collectable element. Accepts any event data as parameters.
NameTypeOptionalDescription
...argsunknown[]NoThe arguments emitted by the listener
Inherited from Collector
handleDispose(...args):Promise<void>
Call this to remove an element from the collection. Accepts any event data as parameters.
NameTypeOptionalDescription
...argsunknown[]NoThe arguments emitted by the listener
Inherited from Collector
Static
key(reaction):Snowflake | string
Gets the collector key for a reaction.
NameTypeOptionalDescription
reactionMessageReactionNoThe message reaction to get the key for
on(event, listener):this
NameTypeOptionalDescription
event'collect' | 'dispose' | 'remove' | 'ignore'NoNone
listener(reaction: MessageReaction, user: User) => voidNoNone
once(event, listener):this
NameTypeOptionalDescription
event'collect' | 'dispose' | 'remove' | 'ignore'NoNone
listener(reaction: MessageReaction, user: User) => voidNoNone
resetTimer(options?):void
Resets the collector's timeout and idle timer.
NameTypeOptionalDescription
optionsCollectorResetTimerOptionsYesOptions for resetting
Inherited from Collector
stop(reason?):void
Stops this collector and emits the end event.
NameTypeOptionalDescription
reasonstringYesThe reason this collector is ending
Inherited from Collector
toJSON():unknown