pub enum CreateInteractionResponse {
Pong,
Message(CreateInteractionResponseMessage),
Defer(CreateInteractionResponseMessage),
Acknowledge,
UpdateMessage(CreateInteractionResponseMessage),
Autocomplete(CreateAutocompleteResponse),
Modal(CreateModal),
PremiumRequired,
LaunchActivity,
}
Expand description
Variants§
Pong
Acknowledges a Ping (only required when your bot uses an HTTP endpoint URL).
Corresponds to Discord’s PONG
.
Message(CreateInteractionResponseMessage)
Responds to an interaction with a message.
Corresponds to Discord’s CHANNEL_MESSAGE_WITH_SOURCE
.
Defer(CreateInteractionResponseMessage)
Acknowledges the interaction in order to edit a response later. The user sees a loading state.
Corresponds to Discord’s DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE
.
Acknowledge
Only valid for component-based interactions (seems to work for modal submit interactions too even though it’s not documented).
Acknowledges the interaction. You can optionally edit the original message later. The user does not see a loading state.
Corresponds to Discord’s DEFERRED_UPDATE_MESSAGE
.
UpdateMessage(CreateInteractionResponseMessage)
Only valid for component-based interactions.
Edits the message the component was attached to.
Corresponds to Discord’s UPDATE_MESSAGE
.
Autocomplete(CreateAutocompleteResponse)
Only valid for autocomplete interactions.
Responds to the autocomplete interaction with suggested choices.
Corresponds to Discord’s APPLICATION_COMMAND_AUTOCOMPLETE_RESULT
.
Modal(CreateModal)
Not valid for Modal and Ping interactions
Responds to the interaction with a popup modal.
Corresponds to Discord’s MODAL
.
PremiumRequired
CreateButton::new_premium
insteadNot valid for autocomplete and Ping interactions. Only available for applications with monetization enabled.
Responds to the interaction with an upgrade button.
Corresponds to Discord’s `PREMIUM_REQUIRED’.
LaunchActivity
Not valid for autocomplete and Ping interactions. Only available for applications with Activities enabled.
Responds to the interaction by launching the Activity associated with the app.
Corresponds to Discord’s LAUNCH_ACTIVITY
.
Trait Implementations§
Source§impl Builder for CreateInteractionResponse
impl Builder for CreateInteractionResponse
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a response to the interaction received.
Note: Message contents must be under 2000 unicode code points, and embeds must be under 6000 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.
Source§type Context<'ctx> = (InteractionId, &'ctx str)
type Context<'ctx> = (InteractionId, &'ctx str)
type Built = ()
Source§impl Clone for CreateInteractionResponse
impl Clone for CreateInteractionResponse
Source§fn clone(&self) -> CreateInteractionResponse
fn clone(&self) -> CreateInteractionResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more