Struct twilight_model::application::interaction::Interaction
source · pub struct Interaction {Show 14 fields
pub app_permissions: Option<Permissions>,
pub application_id: Id<ApplicationMarker>,
pub channel: Option<Channel>,
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: Option<Channel>
The channel the interaction was invoked in.
Present on all interactions types, except Ping
.
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: InteractionType
Type 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: String
Token for responding to the interaction.
user: Option<User>
User that invoked the interaction.
Present when the interaction is invoked in a direct message.
Implementations§
source§impl Interaction
impl Interaction
Trait Implementations§
source§impl Clone for Interaction
impl Clone for Interaction
source§fn clone(&self) -> Interaction
fn clone(&self) -> Interaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Interaction
impl Debug for Interaction
source§impl<'de> Deserialize<'de> for Interaction
impl<'de> Deserialize<'de> for Interaction
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
source§impl PartialEq<Interaction> for Interaction
impl PartialEq<Interaction> for Interaction
source§fn eq(&self, other: &Interaction) -> bool
fn eq(&self, other: &Interaction) -> bool
self
and other
values to be equal, and is used
by ==
.