pub struct InteractionCreate(pub Interaction);Expand description
The data of the Interaction Create dispatch event: a user used a command, component or modal.
discord.js counterpart: the InteractionCreate event.
Dereferences to the contained Interaction.
Tuple Fields§
§0: InteractionMethods from Deref<Target = Interaction>§
Sourcepub fn kind(&self) -> InteractionType
pub fn kind(&self) -> InteractionType
Returns the interaction type.
discord.js counterpart: BaseInteraction#type.
Sourcepub fn command(&self) -> Option<&CommandData>
pub fn command(&self) -> Option<&CommandData>
Returns the command data if a user ran one of the app’s commands (not for
autocomplete, unlike InteractionData::command; D-249).
discord.js counterpart: BaseInteraction#isCommand.
Sourcepub fn autocomplete(&self) -> Option<&CommandData>
pub fn autocomplete(&self) -> Option<&CommandData>
Returns the command data if a user is typing an option with autocomplete (D-249); the
typed option is CommandData::focused.
discord.js counterpart: BaseInteraction#isAutocomplete.
Sourcepub fn component(&self) -> Option<&ComponentData>
pub fn component(&self) -> Option<&ComponentData>
Returns the component data if a user clicked a button or chose in a select menu (D-249).
discord.js counterpart: BaseInteraction#isMessageComponent.
Sourcepub fn modal(&self) -> Option<&ModalSubmitData>
pub fn modal(&self) -> Option<&ModalSubmitData>
Returns the submitted fields if a user submitted one of the app’s modals (D-249).
discord.js counterpart: BaseInteraction#isModalSubmit.