pub struct ModalInteractionCollector { /* private fields */ }
Expand description
A ModalInteractionCollector
receives ModalInteraction
’s match the given filters for a set duration.
Implementations§
Source§impl ModalInteractionCollector
impl ModalInteractionCollector
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(&ModalInteraction) -> bool + Send + Sync + 'static,
) -> Self
pub fn filter( self, filter: impl Fn(&ModalInteraction) -> bool + Send + Sync + 'static, ) -> Self
Sets a generic filter function.
Filters ModalInteraction
’s by a specific UserId
.
Sourcepub fn channel_id(self, channel_id: ChannelId) -> Self
pub fn channel_id(self, channel_id: ChannelId) -> Self
Filters ModalInteraction
’s by a specific ChannelId
.
Sourcepub fn guild_id(self, guild_id: GuildId) -> Self
pub fn guild_id(self, guild_id: GuildId) -> Self
Filters ModalInteraction
’s by a specific GuildId
.
Sourcepub fn message_id(self, message_id: MessageId) -> Self
pub fn message_id(self, message_id: MessageId) -> Self
Filters ModalInteraction
’s by a specific MessageId
.
Sourcepub fn custom_ids(self, custom_ids: Vec<String>) -> Self
pub fn custom_ids(self, custom_ids: Vec<String>) -> Self
Filters ModalInteraction
’s by a specific Vec<String>
.
Sourcepub fn stream(self) -> impl Stream<Item = ModalInteraction>
pub fn stream(self) -> impl Stream<Item = ModalInteraction>
Returns a Stream
over all collected ModalInteraction
.
Sourcepub fn build(self) -> impl Stream<Item = ModalInteraction>
👎Deprecated: use .stream()
instead
pub fn build(self) -> impl Stream<Item = ModalInteraction>
.stream()
insteadDeprecated, use Self::stream()
instead.
Sourcepub async fn next(self) -> Option<ModalInteraction>
pub async fn next(self) -> Option<ModalInteraction>
Returns the next ModalInteraction
which passes the filters.
You can also call .await
on the ModalInteractionCollector
directly.
Trait Implementations§
Source§impl IntoFuture for ModalInteractionCollector
impl IntoFuture for ModalInteractionCollector
Source§type Output = Option<ModalInteraction>
type Output = Option<ModalInteraction>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <ModalInteractionCollector as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <ModalInteractionCollector 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 ModalInteractionCollector
impl !RefUnwindSafe for ModalInteractionCollector
impl Send for ModalInteractionCollector
impl Sync for ModalInteractionCollector
impl Unpin for ModalInteractionCollector
impl !UnwindSafe for ModalInteractionCollector
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