Struct serenity::model::interactions::modal::ModalSubmitInteraction
source · [−]#[non_exhaustive]pub struct ModalSubmitInteraction {Show 13 fields
pub id: InteractionId,
pub application_id: ApplicationId,
pub kind: InteractionType,
pub data: ModalSubmitInteractionData,
pub message: Option<Message>,
pub guild_id: Option<GuildId>,
pub channel_id: ChannelId,
pub member: Option<Member>,
pub user: User,
pub token: String,
pub version: u8,
pub guild_locale: Option<String>,
pub locale: String,
}
Expand description
An interaction triggered by a modal submit.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: InteractionId
Id of the interaction.
application_id: ApplicationId
Id of the application this interaction is for.
kind: InteractionType
The type of interaction.
data: ModalSubmitInteractionData
The data of the interaction which was triggered.
message: Option<Message>
The message this interaction was triggered by Note: Does not exist if the modal interaction originates from an application command interaction
guild_id: Option<GuildId>
The guild Id this interaction was sent from, if there is one.
channel_id: ChannelId
The channel Id this interaction was sent from.
member: Option<Member>
The member
data for the invoking user.
Note: It is only present if the interaction is triggered in a guild.
user: User
The user
object for the invoking user.
token: String
A continuation token for responding to the interaction.
version: u8
Always 1
.
guild_locale: Option<String>
The guild’s preferred locale.
locale: String
The selected language of the invoking user.
Implementations
sourceimpl ModalSubmitInteraction
impl ModalSubmitInteraction
sourcepub async fn get_interaction_response(
&self,
http: impl AsRef<Http>
) -> Result<Message>
Available on crate feature model
only.
pub async fn get_interaction_response(
&self,
http: impl AsRef<Http>
) -> Result<Message>
model
only.sourcepub async fn create_interaction_response<'a, F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<()> where
for<'b> F: FnOnce(&'b mut CreateInteractionResponse<'a>) -> &'b mut CreateInteractionResponse<'a>,
Available on crate feature model
only.
pub async fn create_interaction_response<'a, F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<()> where
for<'b> F: FnOnce(&'b mut CreateInteractionResponse<'a>) -> &'b mut CreateInteractionResponse<'a>,
model
only.Creates a response to the interaction received.
Note: Message contents must be under 2000 unicode code points.
Errors
Returns an Error::Model
if the message content is too long.
May also return an Error::Http
if the API returns an error,
or an Error::Json
if there is an error in deserializing the
API response.
sourcepub async fn edit_original_interaction_response<F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<Message> where
F: FnOnce(&mut EditInteractionResponse) -> &mut EditInteractionResponse,
Available on crate feature model
only.
pub async fn edit_original_interaction_response<F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<Message> where
F: FnOnce(&mut EditInteractionResponse) -> &mut EditInteractionResponse,
model
only.Edits the initial interaction response.
application_id
will usually be the bot’s UserId
, except in cases of bots being very old.
Refer to Discord’s docs for Edit Webhook Message for field information.
Note: Message contents must be under 2000 unicode code points.
Errors
Returns Error::Model
if the edited content is too long.
May also return Error::Http
if the API returns an error,
or an Error::Json
if there is an error deserializing the response.
sourcepub async fn delete_original_interaction_response(
&self,
http: impl AsRef<Http>
) -> Result<()>
Available on crate feature model
only.
pub async fn delete_original_interaction_response(
&self,
http: impl AsRef<Http>
) -> Result<()>
model
only.Deletes the initial interaction response.
Errors
May return Error::Http
if the API returns an error.
Such as if the response was already deleted.
sourcepub async fn create_followup_message<'a, F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<Message> where
for<'b> F: FnOnce(&'b mut CreateInteractionResponseFollowup<'a>) -> &'b mut CreateInteractionResponseFollowup<'a>,
Available on crate feature model
only.
pub async fn create_followup_message<'a, F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<Message> where
for<'b> F: FnOnce(&'b mut CreateInteractionResponseFollowup<'a>) -> &'b mut CreateInteractionResponseFollowup<'a>,
model
only.Creates a followup response to the response sent.
Note: Message contents must be under 2000 unicode code points.
Errors
Will return Error::Model
if the content is too long.
May also return Error::Http
if the API returns an error,
or a Error::Json
if there is an error in deserializing the response.
sourcepub async fn edit_followup_message<'a, F, M: Into<MessageId>>(
&self,
http: impl AsRef<Http>,
message_id: M,
f: F
) -> Result<Message> where
for<'b> F: FnOnce(&'b mut CreateInteractionResponseFollowup<'a>) -> &'b mut CreateInteractionResponseFollowup<'a>,
Available on crate feature model
only.
pub async fn edit_followup_message<'a, F, M: Into<MessageId>>(
&self,
http: impl AsRef<Http>,
message_id: M,
f: F
) -> Result<Message> where
for<'b> F: FnOnce(&'b mut CreateInteractionResponseFollowup<'a>) -> &'b mut CreateInteractionResponseFollowup<'a>,
model
only.Edits a followup response to the response sent.
Note: Message contents must be under 2000 unicode code points.
Errors
Will return Error::Model
if the content is too long.
May also return Error::Http
if the API returns an error,
or a Error::Json
if there is an error in deserializing the response.
sourcepub async fn delete_followup_message<M: Into<MessageId>>(
&self,
http: impl AsRef<Http>,
message_id: M
) -> Result<()>
Available on crate feature model
only.
pub async fn delete_followup_message<M: Into<MessageId>>(
&self,
http: impl AsRef<Http>,
message_id: M
) -> Result<()>
model
only.Deletes a followup message.
Errors
May return Error::Http
if the API returns an error.
Such as if the response was already deleted.
sourcepub async fn defer(&self, http: impl AsRef<Http>) -> Result<()>
Available on crate feature model
only.
pub async fn defer(&self, http: impl AsRef<Http>) -> Result<()>
model
only.Helper function to defer an interaction
Errors
May also return an Error::Http
if the API returns an error,
or an Error::Json
if there is an error in deserializing the
API response.
Errors
Trait Implementations
sourceimpl Clone for ModalSubmitInteraction
impl Clone for ModalSubmitInteraction
sourcefn clone(&self) -> ModalSubmitInteraction
fn clone(&self) -> ModalSubmitInteraction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ModalSubmitInteraction
impl Debug for ModalSubmitInteraction
sourceimpl<'de> Deserialize<'de> for ModalSubmitInteraction
impl<'de> Deserialize<'de> for ModalSubmitInteraction
sourcefn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for ModalSubmitInteraction
impl Serialize for ModalSubmitInteraction
Auto Trait Implementations
impl RefUnwindSafe for ModalSubmitInteraction
impl Send for ModalSubmitInteraction
impl Sync for ModalSubmitInteraction
impl Unpin for ModalSubmitInteraction
impl UnwindSafe for ModalSubmitInteraction
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>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
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