EndReason
Returned alongside the result from.collect(). Indicates why collection ended.
MessageCollector
Collects messages from a specified channel.MessageCollectorOptions
Creating
&mut Client. Registers an internal sender through which the client delivers incoming messages to the collector.
Collecting
.collect() consumes the collector. If you need multiple independent collection passes - create a new collector each time.Example: wait for the next message from a user
Example: wait for the next message from a user
Example: collect 5 messages within 60 seconds
Example: collect 5 messages within 60 seconds
ReactionCollector
Collects reactions on a specified message.ReactionCollectorOptions
Creating
Collecting
CollectedReaction
Structure delivered to the collector from theMessageReactionAdd event.
key()
user_id:emoji_name:emoji_id (for custom emoji) or user_id:emoji_name (for Unicode). Useful for deduplication.
Example: confirm an action via reaction
Example: confirm an action via reaction
Example: poll - collect all reactions within 10 seconds
Example: poll - collect all reactions within 10 seconds
Architecture
Collectors work viampsc::UnboundedSender. When a collector is created, the client stores its sender internally. On every MessageCreate or MessageReactionAdd, the client fans out data to all registered senders.
