pub struct Interaction {Show 17 fields
pub app_permissions: Option<Permissions>,
pub application_id: Id<ApplicationMarker>,
pub authorizing_integration_owners: ApplicationIntegrationMap<AnonymizableId<GuildMarker>, Id<UserMarker>>,
pub channel: Option<Channel>,
pub channel_id: Option<Id<ChannelMarker>>,
pub context: Option<InteractionContextType>,
pub data: Option<InteractionData>,
pub entitlements: Vec<Entitlement>,
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.
application_id: Id<ApplicationMarker>
ID of the associated application.
Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
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
.
context: Option<InteractionContextType>
Context where the interaction was triggered from.
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.
entitlements: Vec<Entitlement>
For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
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 for Interaction
impl PartialEq for Interaction
source§impl Serialize for Interaction
impl Serialize for Interaction
impl StructuralPartialEq for Interaction
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnwindSafe for Interaction
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)