pub struct MessageCollectorBuilder { /* private fields */ }
collector
only.Expand description
Future building a stream of messages.
Implementations
sourceimpl MessageCollectorBuilder
impl MessageCollectorBuilder
sourcepub fn filter_limit(self, limit: u32) -> Self
pub fn filter_limit(self, limit: u32) -> Self
Limits how many messages will attempt to be filtered.
The filter checks whether the message has been sent in the right guild, channel, and by the right author.
sourcepub fn filter<F: Fn(&Arc<Message>) -> bool + 'static + Send + Sync>(
self,
function: F
) -> Self
pub fn filter<F: Fn(&Arc<Message>) -> bool + 'static + Send + Sync>(
self,
function: F
) -> Self
Sets a filter function where messages passed to the function
must
return true
, otherwise the message won’t be collected and failed the filter
process.
This is the last instance to pass for a message to count as collected.
This function is intended to be a message content filter.
Sets the required author ID of a message. If a message does not meet this ID, it won’t be received.
sourcepub fn channel_id(self, channel_id: impl Into<u64>) -> Self
pub fn channel_id(self, channel_id: impl Into<u64>) -> Self
Sets the required channel ID of a message. If a message does not meet this ID, it won’t be received.
sourceimpl MessageCollectorBuilder
impl MessageCollectorBuilder
sourcepub fn new(shard_messenger: impl AsRef<ShardMessenger>) -> Self
pub fn new(shard_messenger: impl AsRef<ShardMessenger>) -> Self
A future that builds a MessageCollector
based on the settings.
sourcepub fn collect_limit(self, limit: u32) -> Self
pub fn collect_limit(self, limit: u32) -> Self
Limits how many messages can be collected.
A message is considered collected, if the message passes all the requirements.
sourcepub fn build(self) -> MessageCollector
pub fn build(self) -> MessageCollector
Use the given configuration to build the MessageCollector
.
Auto Trait Implementations
impl !RefUnwindSafe for MessageCollectorBuilder
impl Send for MessageCollectorBuilder
impl Sync for MessageCollectorBuilder
impl Unpin for MessageCollectorBuilder
impl !UnwindSafe for MessageCollectorBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more