Collects interactions. Will automatically stop if the message ( or ), channel (), or guild () 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.Extends
Collector< Snowflake, T, [Collection<Snowflake, T>] >Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
T | CollectedInteraction | No | None |
Name | Type | Optional | Description |
---|---|---|---|
client | Client<true> | No | None |
options | InteractionCollectorOptions<T> | Yes | None |
Emitted whenever an interaction is collected.
Name | Type | Optional | Description |
---|---|---|---|
interaction | BaseInteraction | No | The interaction that was collected |
Emitted whenever an interaction is disposed of.
Name | Type | Optional | Description |
---|---|---|---|
interaction | BaseInteraction | No | The interaction that was disposed of |
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 |
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 interaction for possible collection.
Returns
Name | Type | Optional | Description |
---|---|---|---|
interaction | Interaction | No | The interaction to possibly collect |
Handles an interaction for possible disposal.
Returns
Name | Type | Optional | Description |
---|---|---|---|
interaction | Interaction | No | The interaction that could be disposed of |
Empties this interaction 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 |
Name | Type | Optional | Description |
---|---|---|---|
event | 'collect' | 'dispose' | 'ignore' | No | None |
listener | (interaction: T) => Awaitable<void> | No | None |
Name | Type | Optional | Description |
---|---|---|---|
event | 'collect' | 'dispose' | 'ignore' | No | None |
listener | (interaction: T) => Awaitable<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 |