Struct serenity::model::interactions::autocomplete::AutocompleteInteraction [−][src]
#[non_exhaustive]pub struct AutocompleteInteraction {
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 recieved when the user fills in an autocomplete option
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
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
pub async fn create_autocomplete_response<F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<()> where
F: FnOnce(&mut CreateAutocompleteResponse) -> &mut CreateAutocompleteResponse,
pub async fn create_autocomplete_response<F>(
&self,
http: impl AsRef<Http>,
f: F
) -> Result<()> where
F: FnOnce(&mut CreateAutocompleteResponse) -> &mut CreateAutocompleteResponse,
Creates a response to an autocomplete interaction.
Errors
Returns an Error::Http
if the API returns an error.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for AutocompleteInteraction
impl Send for AutocompleteInteraction
impl Sync for AutocompleteInteraction
impl Unpin for AutocompleteInteraction
impl UnwindSafe for AutocompleteInteraction
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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