pub struct ReactionCollectorBuilder { /* private fields */ }
collector
only.Implementations
sourceimpl ReactionCollectorBuilder
impl ReactionCollectorBuilder
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 collect_limit(self, limit: u32) -> Self
pub fn collect_limit(self, limit: u32) -> Self
Limits how many reactions can be collected.
A reaction is considered collected, if the reaction passes all the requirements.
sourcepub fn filter<F: Fn(&Arc<Reaction>) -> bool + 'static + Send + Sync>(
self,
function: F
) -> Self
pub fn filter<F: Fn(&Arc<Reaction>) -> bool + 'static + Send + Sync>(
self,
function: F
) -> Self
Sets a filter function where reactions passed to the function must
return true
, otherwise the reaction won’t be collected.
This is the last instance to pass for a reaction to count as collected.
This function is intended to be a reaction content filter.
Sets the required author ID of a reaction. If a reaction is not issued by a user with this ID, it won’t be received.
sourcepub fn message_id(self, message_id: impl Into<u64>) -> Self
pub fn message_id(self, message_id: impl Into<u64>) -> Self
Sets the message on which the reaction must occur. If a reaction is not on a message with this ID, it won’t be received.
sourcepub fn guild_id(self, guild_id: impl Into<u64>) -> Self
pub fn guild_id(self, guild_id: impl Into<u64>) -> Self
Sets the guild in which the reaction must occur. If a reaction is not on a message with this guild 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 channel on which the reaction must occur. If a reaction is not on a message with this channel ID, it won’t be received.
sourcepub fn added(self, is_accepted: bool) -> Self
pub fn added(self, is_accepted: bool) -> Self
If set to true
, added reactions will be collected.
Set to true
by default.
sourceimpl ReactionCollectorBuilder
impl ReactionCollectorBuilder
pub fn new(shard_messenger: impl AsRef<ShardMessenger>) -> Self
sourcepub fn build(self) -> ReactionCollector
pub fn build(self) -> ReactionCollector
Use the given configuration to build the ReactionCollector
.
Auto Trait Implementations
impl !RefUnwindSafe for ReactionCollectorBuilder
impl Send for ReactionCollectorBuilder
impl Sync for ReactionCollectorBuilder
impl Unpin for ReactionCollectorBuilder
impl !UnwindSafe for ReactionCollectorBuilder
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