Struct serenity::model::interactions::application_command::ApplicationCommandInteraction[][src]

#[non_exhaustive]
pub struct ApplicationCommandInteraction { pub id: InteractionId, pub application_id: ApplicationId, pub kind: InteractionType, pub data: ApplicationCommandInteractionData, 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 when a user invokes a slash command.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: ApplicationCommandInteractionData

The data of the interaction which was triggered.

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

Gets the interaction response.

Errors

Returns an Error::Http if there is no interaction response.

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.

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, does not work on ephemeral messages.

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.

Deletes the initial interaction response.

Errors

May return Error::Http if the API returns an error. Such as if the response was already deleted.

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.

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.

Deletes a followup message.

Errors

May return Error::Http if the API returns an error. Such as if the response was already deleted.

Gets a followup message.

Errors

May return Error::Http if the API returns an error. Such as if the response was deleted.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more