#[non_exhaustive]pub enum InteractionData {
Ping,
ApplicationCommand(Box<CommandData>),
MessageComponent(Box<ComponentData>),
Autocomplete(Box<CommandData>),
ModalSubmit(Box<ModalSubmitData>),
Unknown(InteractionType),
}Expand description
The data
of an Interaction, by interaction type (D-067).
The variant decides the interaction’s type: it is decoded
from type and data together and written back as both.
discord.js counterpart: the data of APIInteraction (discord-api-types).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ping
Discord checks the app’s HTTP interactions endpoint; answer with
InteractionResponse::Pong.
ApplicationCommand(Box<CommandData>)
A user ran one of the app’s commands.
discord.js counterpart: ChatInputCommandInteraction, UserContextMenuCommandInteraction,
MessageContextMenuCommandInteraction, PrimaryEntryPointCommandInteraction.
MessageComponent(Box<ComponentData>)
A user clicked a button or chose in a select menu on one of the app’s messages.
discord.js counterpart: ButtonInteraction, StringSelectMenuInteraction and the other
select menu interactions.
Autocomplete(Box<CommandData>)
A user is typing an option with autocomplete; one option is
Focused.
discord.js counterpart: AutocompleteInteraction.
ModalSubmit(Box<ModalSubmitData>)
A user submitted one of the app’s modals.
discord.js counterpart: ModalSubmitInteraction.
Unknown(InteractionType)
An interaction type this version does not know; its data is not kept.
Implementations§
Source§impl InteractionData
impl InteractionData
Sourcepub const fn kind(&self) -> InteractionType
pub const fn kind(&self) -> InteractionType
Returns the interaction type this data belongs to.
discord.js counterpart: BaseInteraction#type.
Sourcepub fn command(&self) -> Option<&CommandData>
pub fn command(&self) -> Option<&CommandData>
Returns the command data of command and autocomplete interactions (see
Interaction::command and
Interaction::autocomplete for one kind).
discord.js counterpart: the command fields of CommandInteraction.