Collects messages on a channel. Will automatically stop if the channel (), thread (), or guild () is deleted.
Name | Type | Optional | Description |
---|---|---|---|
channel | TextBasedChannel | No | None |
options | MessageCollectorOptions | Yes | None |
Emitted whenever a message is collected.
Name | Type | Optional | Description |
---|---|---|---|
message | Message | No | The message that was collected |
Emitted whenever a message is disposed of.
Name | Type | Optional | Description |
---|---|---|---|
message | Message | No | The message 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 a message for possible collection.
Returns
Name | Type | Optional | Description |
---|---|---|---|
message | Message | No | The message that could be collected |
Handles a message for possible disposal.
Returns
Name | Type | Optional | Description |
---|---|---|---|
message | Message | No | The message that could be disposed of |
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 | EventKey | No | None |
listener | (...args: CollectorEventTypes<K, V, F>[EventKey]) => Awaitable<void> | No | None |
Name | Type | Optional | Description |
---|---|---|---|
event | EventKey | No | None |
listener | (...args: CollectorEventTypes<K, V, F>[EventKey]) => 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 |