pub struct ReactionCollector { /* private fields */ }
Expand description
A ReactionCollector
receives Reaction
’s match the given filters for a set duration.
Implementations§
Source§impl ReactionCollector
impl ReactionCollector
Sourcepub fn new(shard: impl AsRef<ShardMessenger>) -> Self
pub fn new(shard: impl AsRef<ShardMessenger>) -> Self
Creates a new collector without any filters configured.
Sourcepub fn timeout(self, duration: Duration) -> Self
pub fn timeout(self, duration: Duration) -> Self
Sets a duration for how long the collector shall receive interactions.
Sourcepub fn filter(
self,
filter: impl Fn(&Reaction) -> bool + Send + Sync + 'static,
) -> Self
pub fn filter( self, filter: impl Fn(&Reaction) -> bool + Send + Sync + 'static, ) -> Self
Sets a generic filter function.
Sourcepub fn channel_id(self, channel_id: ChannelId) -> Self
pub fn channel_id(self, channel_id: ChannelId) -> Self
Sourcepub fn message_id(self, message_id: MessageId) -> Self
pub fn message_id(self, message_id: MessageId) -> Self
Sourcepub fn build(self) -> impl Stream<Item = Reaction>
👎Deprecated: use .stream()
instead
pub fn build(self) -> impl Stream<Item = Reaction>
.stream()
insteadDeprecated, use Self::stream()
instead.
Trait Implementations§
Source§impl IntoFuture for ReactionCollector
impl IntoFuture for ReactionCollector
Source§type IntoFuture = Pin<Box<dyn Future<Output = <ReactionCollector as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <ReactionCollector as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl Freeze for ReactionCollector
impl !RefUnwindSafe for ReactionCollector
impl Send for ReactionCollector
impl Sync for ReactionCollector
impl Unpin for ReactionCollector
impl !UnwindSafe for ReactionCollector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more