Interaction responses and follow-ups.
Inside a bot, Lingo.Context answers interactions for you; these are for
answering them by hand, with the interaction's id and token.
Summary
Types
What an interaction response did, from with_response: true. interaction
holds the interaction's id and type (as in Lingo.Type.Interaction)
and the response's ids and state; resource what it created: its type
(as create_response/5 takes it) and the message sent or the
activity_instance launched (%{id: instance_id}).
Functions
Sends a follow-up message to an interaction.
Responds to an interaction. type is one of :channel_message,
:deferred_channel_message, :deferred_update_message, :update_message,
:autocomplete, :modal, :launch_activity or :pong. With
with_response: true it returns what the response did (see
callback_response/0).
Deletes a follow-up message.
Deletes the first response to an interaction.
Fetches a follow-up message.
Fetches the first response to an interaction.
Edits a follow-up message.
Edits the first response to an interaction.
Types
@type callback_response() :: %{ interaction: %{ id: Lingo.Api.id(), type: Lingo.Type.Interaction.interaction_type() | integer(), activity_instance_id: String.t() | nil, response_message_id: Lingo.Api.id() | nil, response_message_loading: boolean() | nil, response_message_ephemeral: boolean() | nil }, resource: %{ type: atom() | integer(), activity_instance: %{id: String.t()} | nil, message: Lingo.Type.Message.t() | nil } | nil }
What an interaction response did, from with_response: true. interaction
holds the interaction's id and type (as in Lingo.Type.Interaction)
and the response's ids and state; resource what it created: its type
(as create_response/5 takes it) and the message sent or the
activity_instance launched (%{id: instance_id}).
Functions
@spec create_followup(String.t(), Lingo.Api.content()) :: Lingo.Api.result(Lingo.Type.Message.t())
Sends a follow-up message to an interaction.
@spec create_response(Lingo.Api.id(), String.t(), atom(), map() | nil, keyword()) :: Lingo.Api.result() | Lingo.Api.result(callback_response())
Responds to an interaction. type is one of :channel_message,
:deferred_channel_message, :deferred_update_message, :update_message,
:autocomplete, :modal, :launch_activity or :pong. With
with_response: true it returns what the response did (see
callback_response/0).
@spec delete_followup(String.t(), Lingo.Api.id()) :: Lingo.Api.result()
Deletes a follow-up message.
@spec delete_original_response(String.t()) :: Lingo.Api.result()
Deletes the first response to an interaction.
@spec get_followup(String.t(), Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Message.t())
Fetches a follow-up message.
@spec get_original_response(String.t()) :: Lingo.Api.result(Lingo.Type.Message.t())
Fetches the first response to an interaction.
@spec update_followup(String.t(), Lingo.Api.id(), Lingo.Api.content()) :: Lingo.Api.result(Lingo.Type.Message.t())
Edits a follow-up message.
@spec update_original_response(String.t(), Lingo.Api.content()) :: Lingo.Api.result(Lingo.Type.Message.t())
Edits the first response to an interaction.