pub struct ApplicationCommand {
    pub application_id: Id<ApplicationMarker>,
    pub channel_id: Id<ChannelMarker>,
    pub data: CommandData,
    pub guild_id: Option<Id<GuildMarker>>,
    pub guild_locale: Option<String>,
    pub id: Id<InteractionMarker>,
    pub kind: InteractionType,
    pub locale: String,
    pub member: Option<PartialMember>,
    pub token: String,
    pub user: Option<User>,
}
Expand description

Data present in an Interaction of type ApplicationCommand.

Fields

application_id: Id<ApplicationMarker>

ID of the associated application.

channel_id: Id<ChannelMarker>

ID of the channel the interaction was invoked in.

data: CommandData

Data from the invoked command.

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 command is used in a guild.

Defaults to en-US.

id: Id<InteractionMarker>

ID of the interaction.

kind: InteractionType

Kind of the interaction.

Should always be InteractionType::ApplicationCommand.

locale: String

Selected language of the user who invoked the interaction.

member: Option<PartialMember>

Member that invoked the interaction.

Present when the command is used in a guild.

token: String

Token of the interaction.

user: Option<User>

User that invoked the interaction.

Present when the command is used in a direct message.

Implementations

ID of the user that invoked the interaction.

This will first check for the member’s user’s ID and, if not present, then check the user’s ID.

Whether the interaction was invoked in a DM.

Whether the interaction was invoked in a guild.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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