class InteractionCollector
extends
Collector< Snowflake, Interaction, [Collection<Snowflake, Interaction>]>export class InteractionCollector<Interaction extends CollectedInteraction> extends Collector< Snowflake, Interaction, [Collection<Snowflake, Interaction>]>
Collects interactions. Will automatically stop if the message (messageDelete or messageDeleteBulk), channel (channelDelete), or guild (guildDelete) is deleted. Interaction collectors that do not specify time
or idle
may be prone to always running. Ensure your interaction collectors end via either of these options or manual cancellation.
Constructors
client: Client<true>options?: InteractionCollectorOptions<Interaction>)
constructor(Type Parameters
CollectedInteraction Interaction extends
readonlyClient client :
The client that instantiated this Collector
Collection collected :
The items collected by this collector
ComponentType | null componentType :
The type of component to collect
boolean ended :
Whether this collector has finished collecting
readonlyoptionalstring endReason? :
The reason this collector has ended with, or null if it hasn't ended yet
CollectorFilter filter :
The filter applied to this collector
InteractionType | null interactionType :
The type of interaction to collect
optionalDate lastCollectedAt? :
The Date at which this collector last collected an item
optionalnumber lastCollectedTimestamp? :
The timestamp at which this collector last collected an item
The message interaction id from which to collect interactions, if provided
readonlyPromise next :
Returns a promise that resolves with the next collected element; rejects with collected elements if the collector finishes without receiving a next element
InteractionCollectorOptions<Interaction> options :
The options of this collector
number total :
The total number of interactions collected
Collection<Snowflake, User> users :
The users that have interacted with this collector
[Symbol.asyncIterator]AsyncIterableIterator<[Interaction, ...[]> () :
Inherited from: Collector
checkEndboolean () :
Checks whether the collector should end, and if so, ends it.
Returns: Whether the collector ended or not
Inherited from: Collector
collectinteraction: Interaction) : Snowflake (
Handles an incoming interaction for possible collection.
disposeinteraction: Interaction) : Snowflake (
Handles an interaction for possible disposal.
emptyvoid () :
Empties this interaction collector.
Call this to handle an event as a collectable element. Accepts any event data as parameters.
Inherited from: Collector
Call this to remove an element from the collection. Accepts any event data as parameters.
Inherited from: Collector
resetTimeroptions?: CollectorResetTimerOptions) : void (
Resets the collector's timeout and idle timer.
Inherited from: Collector
collectinteraction: BaseInteraction) (
Emitted whenever an interaction is collected.
disposeinteraction: BaseInteraction) (
Emitted whenever an interaction is disposed of.
endcollected: Collectionreason: string) (
Emitted when the collector is finished collecting.
ignoreargs: any) (
Emitted whenever an element is not collected by the collector.