Struct twilight_model::application::interaction::Interaction
source · [−]pub struct Interaction {Show 13 fields
pub app_permissions: Option<Permissions>,
pub application_id: Id<ApplicationMarker>,
pub channel_id: Option<Id<ChannelMarker>>,
pub data: Option<InteractionData>,
pub guild_id: Option<Id<GuildMarker>>,
pub guild_locale: Option<String>,
pub id: Id<InteractionMarker>,
pub kind: InteractionType,
pub locale: Option<String>,
pub member: Option<PartialMember>,
pub message: Option<Message>,
pub token: String,
pub user: Option<User>,
}Expand description
Payload received when a user executes an interaction.
Fields
app_permissions: Option<Permissions>App’s permissions in the channel the interaction was sent from.
Present when the interaction is invoked in a guild.
application_id: Id<ApplicationMarker>ID of the associated application.
channel_id: Option<Id<ChannelMarker>>ID of the channel the interaction was invoked in.
Present on all interactions types, except Ping.
data: Option<InteractionData>Data from the interaction.
This field present on ApplicationCommand, MessageComponent,
ApplicationCommandAutocomplete and ModalSubmit interactions.
The inner enum variant matches the interaction type.
guild_id: Option<Id<GuildMarker>>ID of the guild the interaction was invoked in.
guild_locale: Option<String>Guild’s preferred locale.
Present when the interaction is invoked in a guild.
id: Id<InteractionMarker>ID of the interaction.
kind: InteractionTypeType of interaction.
locale: Option<String>Selected language of the user who invoked the interaction.
Present on all interactions types, except Ping.
member: Option<PartialMember>Member that invoked the interaction.
Present when the interaction is invoked in a guild.
message: Option<Message>Message attached to the interaction.
Present on MessageComponent interactions.
token: StringToken for responding to the interaction.
user: Option<User>User that invoked the interaction.
Present when the interaction is invoked in a direct message.
Implementations
sourceimpl Interaction
impl Interaction
Trait Implementations
sourceimpl Clone for Interaction
impl Clone for Interaction
sourcefn clone(&self) -> Interaction
fn clone(&self) -> Interaction
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 Interaction
impl Debug for Interaction
sourceimpl<'de> Deserialize<'de> for Interaction
impl<'de> Deserialize<'de> for Interaction
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Interaction> for Interaction
impl PartialEq<Interaction> for Interaction
sourcefn eq(&self, other: &Interaction) -> bool
fn eq(&self, other: &Interaction) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl Serialize for Interaction
impl Serialize for Interaction
impl StructuralPartialEq for Interaction
Auto Trait Implementations
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnwindSafe for Interaction
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> 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