Struct serenity::collector::ModalInteractionCollector
source · pub struct ModalInteractionCollector { /* private fields */ }
Available on crate feature
collector
only.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
§type Output = Option<ModalInteraction>
type Output = Option<ModalInteraction>
The output that the future will produce on completion.
§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 !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