Collects messages on a channel. Will automatically stop if the channel (channelDelete), thread (threadDelete), or guild (guildDelete) 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 |
Emitted whenever an element is not collected by the collector.
Name | Type | Optional | Description |
---|---|---|---|
args | any | No | The arguments emitted by the listener |
Returns a promise that resolves with the next collected element; rejects with collected elements if the collector finishes without receiving a next element
Checks 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 | Constraints | Optional | Default | Description |
---|---|---|---|---|
EventKey | keyof CollectorEventTypes<Snowflake, Message, [> | No | None |
Name | Type | Optional | Description |
---|---|---|---|
event | EventKey | No | None |
listener | (...args: CollectorEventTypes<Snowflake, Message, [>[EventKey]) => Awaitable<void> | No | None |
Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
EventKey | keyof CollectorEventTypes<Snowflake, Message, [> | No | None |
Name | Type | Optional | Description |
---|---|---|---|
event | EventKey | No | None |
listener | (...args: CollectorEventTypes<Snowflake, Message, [>[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 |