slackline/interaction
This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.
Interactivity: the payloads Slack sends to an app’s interactivity
Request URL (as the json in the payload form field) or over Socket
Mode interactive envelopes, and the responses an app sends back.
See https://docs.slack.dev/reference/interaction-payloads and https://docs.slack.dev/interactivity/handling-user-interaction.
Types
One action in a block_actions payload. The element type selects the
variant.
pub type BlockAction {
ButtonAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
text: option.Option(block.Text),
value: option.Option(String),
style: option.Option(String),
)
WorkflowButtonAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
text: option.Option(block.Text),
value: option.Option(String),
)
IconButtonAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
value: option.Option(String),
)
FeedbackButtonsAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
value: option.Option(String),
)
OverflowAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
selected_option: option.Option(block.SelectOption),
)
CheckboxesAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
selected_options: option.Option(List(block.SelectOption)),
)
RadioButtonsAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
selected_option: option.Option(block.SelectOption),
)
StaticSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_option: option.Option(block.SelectOption),
)
ExternalSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_option: option.Option(block.SelectOption),
)
UsersSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_user: option.Option(String),
)
ConversationsSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_conversation: option.Option(String),
)
ChannelsSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_channel: option.Option(String),
)
MultiStaticSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_options: option.Option(List(block.SelectOption)),
)
MultiExternalSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_options: option.Option(List(block.SelectOption)),
)
MultiUsersSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_users: option.Option(List(String)),
)
MultiConversationsSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_conversations: option.Option(List(String)),
)
MultiChannelsSelectAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
placeholder: option.Option(block.Text),
selected_channels: option.Option(List(String)),
)
DatepickerAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
selected_date: option.Option(String),
)
TimepickerAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
selected_time: option.Option(String),
timezone: option.Option(String),
)
DatetimepickerAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
selected_date_time: option.Option(Int),
)
PlainTextInputAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
value: option.Option(String),
)
EmailTextInputAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
value: option.Option(String),
)
UrlTextInputAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
value: option.Option(String),
)
NumberInputAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
value: option.Option(String),
)
RichTextInputAction(
action_id: String,
block_id: option.Option(String),
action_ts: option.Option(String),
rich_text_value: option.Option(block.RichText),
)
UnknownBlockAction(type_: String, raw: value.Value)
}
Constructors
-
ButtonAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), text: option.Option(block.Text), value: option.Option(String), style: option.Option(String), )Arguments
- text
-
The button’s text.
- value
-
The value set on the button.
- style
-
The button style,
primaryordanger.
-
WorkflowButtonAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), text: option.Option(block.Text), value: option.Option(String), ) -
IconButtonAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), value: option.Option(String), ) -
FeedbackButtonsAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), value: option.Option(String), )Arguments
- value
-
The
valueof the button that was pressed.
-
OverflowAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), selected_option: option.Option(block.SelectOption), )Arguments
- selected_option
-
The option that was clicked.
-
CheckboxesAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), selected_options: option.Option(List(block.SelectOption)), )Arguments
- selected_options
-
Every checked option.
-
RadioButtonsAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), selected_option: option.Option(block.SelectOption), )Arguments
- selected_option
-
The selected radio button. Null after deselection.
-
StaticSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_option: option.Option(block.SelectOption), )Arguments
- selected_option
-
The chosen option. Null when the user deselects it.
-
ExternalSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_option: option.Option(block.SelectOption), ) -
UsersSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_user: option.Option(String), )Arguments
- selected_user
-
The chosen user ID.
-
ConversationsSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_conversation: option.Option(String), )Arguments
- selected_conversation
-
The chosen conversation ID.
-
ChannelsSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_channel: option.Option(String), )Arguments
- selected_channel
-
The chosen public channel ID.
-
MultiStaticSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_options: option.Option(List(block.SelectOption)), ) -
MultiExternalSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_options: option.Option(List(block.SelectOption)), ) -
MultiUsersSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_users: option.Option(List(String)), ) -
MultiConversationsSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_conversations: option.Option(List(String)), ) -
MultiChannelsSelectAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), placeholder: option.Option(block.Text), selected_channels: option.Option(List(String)), ) -
DatepickerAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), selected_date: option.Option(String), )Arguments
- selected_date
-
The chosen date,
YYYY-MM-DD.
-
TimepickerAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), selected_time: option.Option(String), timezone: option.Option(String), )Arguments
- selected_time
-
The chosen time,
HH:mm. - timezone
-
The IANA timezone configured on the element.
-
DatetimepickerAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), selected_date_time: option.Option(Int), )Arguments
- selected_date_time
-
The chosen date and time as a UNIX timestamp in seconds.
-
PlainTextInputAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), value: option.Option(String), )Sent when the input block has
dispatch_actionset. -
EmailTextInputAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), value: option.Option(String), ) -
UrlTextInputAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), value: option.Option(String), ) -
NumberInputAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), value: option.Option(String), )Arguments
- value
-
The number as typed, a string.
-
RichTextInputAction( action_id: String, block_id: option.Option(String), action_ts: option.Option(String), rich_text_value: option.Option(block.RichText), )Arguments
- rich_text_value
-
The entered text as a
rich_textobject.
-
UnknownBlockAction(type_: String, raw: value.Value)A
typethat this version of slackline does not know.rawholds the full json.
Received when a user interacts with a Block Kit interactive component. https://docs.slack.dev/reference/interaction-payloads/block_actions-payload
pub type BlockActionsPayload {
BlockActionsPayload(
user: InteractionUser,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
api_app_id: option.Option(String),
token: option.Option(String),
container: option.Option(Container),
trigger_id: option.Option(String),
channel: option.Option(InteractionChannel),
message: option.Option(message.Message),
view: option.Option(view.View),
actions: option.Option(List(BlockAction)),
state: option.Option(view.ViewState),
hash: option.Option(String),
response_url: option.Option(String),
function_data: option.Option(FunctionData),
interactivity: option.Option(Interactivity),
bot_access_token: option.Option(String),
)
}
Constructors
-
BlockActionsPayload( user: InteractionUser, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), api_app_id: option.Option(String), token: option.Option(String), container: option.Option(Container), trigger_id: option.Option(String), channel: option.Option(InteractionChannel), message: option.Option(message.Message), view: option.Option(view.View), actions: option.Option(List(BlockAction)), state: option.Option(view.ViewState), hash: option.Option(String), response_url: option.Option(String), function_data: option.Option(FunctionData), interactivity: option.Option(Interactivity), bot_access_token: option.Option(String), )Arguments
- user
-
The user who interacted to trigger this request.
- team
-
The workspace the app is installed on. Null if the app is org-installed.
- enterprise
-
The enterprise the installed app is part of, if the app is either workspace-installed on an org, or org-installed.
- is_enterprise_install
-
Whether the app is installed at the org level.
- api_app_id
-
A string representing the app ID.
- token
-
A deprecated verification token. Validate requests with the signing secret instead.
- container
-
The container where this block action took place.
- trigger_id
-
A short-lived ID that can be used to open modals.
- channel
-
The channel where this block action took place.
- message
-
The message where this block action took place, if the block was contained in a message.
- view
-
The view where this block action took place, if the block was contained in a view.
- actions
-
Data from the specific interactive components that were used.
- state
-
All stateful elements of the surface, not only input blocks.
- hash
-
A value accepted by
views.updateandviews.publishto make sure only the most recent view is updated. - response_url
-
A short-lived webhook that can be used to send messages in response to interactions.
- function_data
-
Metadata about the function execution that generated the block (apps built with the Deno Slack SDK).
- interactivity
-
An interactivity object generated as a result of the block action (functions only).
- bot_access_token
-
A workflow (just-in-time) token generated for this block action (functions only).
Received when a select menu of external data source needs options.
Respond with an OptionsResponse.
https://docs.slack.dev/reference/interaction-payloads/block_suggestion-payload
pub type BlockSuggestionPayload {
BlockSuggestionPayload(
user: InteractionUser,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
api_app_id: option.Option(String),
token: option.Option(String),
container: option.Option(Container),
block_id: String,
action_id: String,
value: String,
channel: option.Option(InteractionChannel),
message: option.Option(message.Message),
view: option.Option(view.View),
function_data: option.Option(FunctionData),
bot_access_token: option.Option(String),
)
}
Constructors
-
BlockSuggestionPayload( user: InteractionUser, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), api_app_id: option.Option(String), token: option.Option(String), container: option.Option(Container), block_id: String, action_id: String, value: String, channel: option.Option(InteractionChannel), message: option.Option(message.Message), view: option.Option(view.View), function_data: option.Option(FunctionData), bot_access_token: option.Option(String), )Arguments
- user
-
The user that initiated the block suggestion interaction.
team_idis an enterprise ID on Enterprise orgs. - team
-
The workspace the interaction originated from.
- enterprise
-
The enterprise the installed app is part of, if any.
- is_enterprise_install
-
Whether the app is installed at the org level.
- api_app_id
-
The encoded application ID the event was dispatched to.
- token
-
A deprecated verification token.
- container
-
The container where this block suggestion took place.
- block_id
-
Identifies the block that contained the select menu.
- action_id
-
Identifies the select menu itself.
- value
-
The value the user entered into the select menu.
- channel
-
The channel the interaction originated from.
- message
-
The message where this block suggestion took place, if the block was contained in a message.
- view
-
The view where this block suggestion took place, if the block was contained in a view.
- function_data
-
Metadata about the function execution (functions only).
- bot_access_token
-
A workflow (just-in-time) token (functions only).
Where a block action or suggestion took place.
pub type Container {
MessageContainer(
message_ts: option.Option(String),
channel_id: option.Option(String),
is_ephemeral: option.Option(Bool),
thread_ts: option.Option(String),
)
MessageAttachmentContainer(
message_ts: option.Option(String),
attachment_id: option.Option(Int),
channel_id: option.Option(String),
is_ephemeral: option.Option(Bool),
is_app_unfurl: option.Option(Bool),
)
ViewContainer(view_id: option.Option(String))
UnknownContainer(type_: String, raw: value.Value)
}
Constructors
-
MessageContainer( message_ts: option.Option(String), channel_id: option.Option(String), is_ephemeral: option.Option(Bool), thread_ts: option.Option(String), )A block in a message.
-
MessageAttachmentContainer( message_ts: option.Option(String), attachment_id: option.Option(Int), channel_id: option.Option(String), is_ephemeral: option.Option(Bool), is_app_unfurl: option.Option(Bool), )A block in a secondary message attachment.
-
ViewContainer(view_id: option.Option(String))A block in a modal or Home tab view.
-
UnknownContainer(type_: String, raw: value.Value)A
typethat this version of slackline does not know.rawholds the full json.
Legacy: a dialog opened with notify_on_cancel: true was dismissed.
pub type DialogCancellationPayload {
DialogCancellationPayload(
callback_id: String,
state: option.Option(String),
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
user: InteractionUser,
channel: option.Option(InteractionChannel),
action_ts: option.Option(String),
token: option.Option(String),
response_url: option.Option(String),
)
}
Constructors
-
DialogCancellationPayload( callback_id: String, state: option.Option(String), team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), user: InteractionUser, channel: option.Option(InteractionChannel), action_ts: option.Option(String), token: option.Option(String), response_url: option.Option(String), )Arguments
- callback_id
-
The
callback_idthe app gave this dialog. - state
-
The
statestring the app passed todialog.open. - team
-
The workspace from which this interaction occurred.
- enterprise
-
The enterprise the installed app is part of, if any.
- user
-
The user who dismissed the dialog.
- channel
-
The channel where the dialog was opened.
- action_ts
-
A unique identifier for this action occurrence.
- token
-
A deprecated verification token.
- response_url
-
A URL that can be used to follow up with the user.
Legacy: one rejected dialog element.
pub type DialogError {
DialogError(name: String, error: String)
}
Constructors
-
DialogError(name: String, error: String)Arguments
- name
-
The
nameof the element being rejected. - error
-
Why the element is being rejected.
Legacy: the body an app returns to reject a dialog_submission.
pub type DialogErrorsResponse {
DialogErrorsResponse(errors: List(DialogError))
}
Constructors
-
DialogErrorsResponse(errors: List(DialogError))
Legacy: a dialog select option. Dialogs use label, not text.
pub type DialogOption {
DialogOption(label: String, value: String)
}
Constructors
-
DialogOption(label: String, value: String)Arguments
- label
-
A user-facing label, 75 characters maximum.
- value
-
The value sent to the app, 75 characters maximum.
Legacy: a group of dialog select options.
pub type DialogOptionGroup {
DialogOptionGroup(label: String, options: List(DialogOption))
}
Constructors
-
DialogOptionGroup(label: String, options: List(DialogOption))Arguments
- label
-
A user-facing label for the group, 75 characters maximum.
- options
-
The options in the group.
Legacy: the body an app returns to a dialog_suggestion payload.
pub type DialogOptionsResponse {
DialogOptionsResponse(
options: option.Option(List(DialogOption)),
option_groups: option.Option(List(DialogOptionGroup)),
)
}
Constructors
-
DialogOptionsResponse( options: option.Option(List(DialogOption)), option_groups: option.Option(List(DialogOptionGroup)), )
Legacy: a dialog was submitted. Respond with an empty 200 or a
DialogErrorsResponse.
https://docs.slack.dev/legacy/legacy-dialogs#submit
pub type DialogSubmissionPayload {
DialogSubmissionPayload(
submission: dict.Dict(String, value.Value),
callback_id: String,
state: option.Option(String),
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
user: InteractionUser,
channel: option.Option(InteractionChannel),
action_ts: option.Option(String),
token: option.Option(String),
response_url: option.Option(String),
)
}
Constructors
-
DialogSubmissionPayload( submission: dict.Dict(String, value.Value), callback_id: String, state: option.Option(String), team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), user: InteractionUser, channel: option.Option(InteractionChannel), action_ts: option.Option(String), token: option.Option(String), response_url: option.Option(String), )Arguments
- submission
-
The submitted values, keyed by the element
name. Values are strings (or null for empty optional elements). - callback_id
-
The
callback_idthe app gave this dialog. - state
-
The
statestring the app passed todialog.open. - team
-
The workspace from which this interaction occurred.
- enterprise
-
The enterprise the installed app is part of, if any.
- user
-
The user who completed the form.
- channel
-
The channel where this dialog was completed.
- action_ts
-
A unique identifier for this action occurrence.
- token
-
A deprecated verification token.
- response_url
-
A URL that can be used to post responses to the submission.
Legacy: a dialog select with data_source: external needs options.
Respond with a DialogOptionsResponse.
pub type DialogSuggestionPayload {
DialogSuggestionPayload(
callback_id: String,
name: option.Option(String),
value: option.Option(String),
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
user: InteractionUser,
channel: option.Option(InteractionChannel),
action_ts: option.Option(String),
token: option.Option(String),
)
}
Constructors
-
DialogSuggestionPayload( callback_id: String, name: option.Option(String), value: option.Option(String), team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), user: InteractionUser, channel: option.Option(InteractionChannel), action_ts: option.Option(String), token: option.Option(String), )Arguments
- callback_id
-
The
callback_idthe app gave this dialog. - name
-
The name of the select element.
- value
-
What the user has typed so far.
- team
-
The workspace from which this interaction occurred.
- enterprise
-
The enterprise the installed app is part of, if any.
- user
-
The user interacting with the dialog.
- channel
-
The channel where the dialog was opened.
- action_ts
-
A unique identifier for this action occurrence.
- token
-
A deprecated verification token.
Metadata about the function execution that generated a block or view.
pub type FunctionData {
FunctionData(
execution_id: option.Option(String),
function: option.Option(FunctionRef),
inputs: option.Option(dict.Dict(String, value.Value)),
)
}
Constructors
-
FunctionData( execution_id: option.Option(String), function: option.Option(FunctionRef), inputs: option.Option(dict.Dict(String, value.Value)), )Arguments
- execution_id
-
The function execution ID.
- function
-
The function being executed.
- inputs
-
The inputs the function was called with.
A reference to a function by its callback_id.
pub type FunctionRef {
FunctionRef(callback_id: String)
}
Constructors
-
FunctionRef(callback_id: String)
Received when a global shortcut is used. https://docs.slack.dev/reference/interaction-payloads/shortcuts-interaction-payload
pub type GlobalShortcutPayload {
GlobalShortcutPayload(
callback_id: String,
trigger_id: option.Option(String),
user: InteractionUser,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
token: option.Option(String),
action_ts: option.Option(String),
)
}
Constructors
-
GlobalShortcutPayload( callback_id: String, trigger_id: option.Option(String), user: InteractionUser, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), token: option.Option(String), action_ts: option.Option(String), )Arguments
- callback_id
-
The ID defined when creating the shortcut.
- trigger_id
-
A temporary ID that can be used to open modals.
- user
-
The user who initiated the shortcut.
- team
-
The workspace the shortcut was initiated in.
- enterprise
-
The enterprise the installed app is part of, if any.
- is_enterprise_install
-
Whether the app is installed at the org level.
- token
-
A deprecated verification token.
- action_ts
-
When the shortcut was used.
An interaction payload, dispatched on type. Each variant wraps the
payload record, so handlers can take exactly the payload they handle.
pub type Interaction {
BlockActions(BlockActionsPayload)
BlockSuggestion(BlockSuggestionPayload)
ViewSubmission(ViewSubmissionPayload)
ViewClosed(ViewClosedPayload)
GlobalShortcut(GlobalShortcutPayload)
MessageShortcut(MessageShortcutPayload)
InteractiveMessage(InteractiveMessagePayload)
DialogSubmission(DialogSubmissionPayload)
DialogCancellation(DialogCancellationPayload)
DialogSuggestion(DialogSuggestionPayload)
UnknownInteraction(type_: String, raw: value.Value)
}
Constructors
-
BlockActions(BlockActionsPayload) -
BlockSuggestion(BlockSuggestionPayload) -
ViewSubmission(ViewSubmissionPayload) -
ViewClosed(ViewClosedPayload) -
GlobalShortcut(GlobalShortcutPayload) -
MessageShortcut(MessageShortcutPayload) -
InteractiveMessage(InteractiveMessagePayload) -
DialogSubmission(DialogSubmissionPayload) -
DialogCancellation(DialogCancellationPayload) -
DialogSuggestion(DialogSuggestionPayload) -
UnknownInteraction(type_: String, raw: value.Value)A
typethat this version of slackline does not know.rawholds the full json.
The channel an interaction happened in.
pub type InteractionChannel {
InteractionChannel(id: String, name: option.Option(String))
}
Constructors
-
InteractionChannel(id: String, name: option.Option(String))Arguments
- id
-
The channel ID.
- name
-
The channel name, without the leading
#.
The enterprise organization an app is installed in.
pub type InteractionEnterprise {
InteractionEnterprise(id: String, name: option.Option(String))
}
Constructors
-
InteractionEnterprise(id: String, name: option.Option(String))Arguments
- id
-
The enterprise ID.
- name
-
The enterprise name.
The workspace an interaction happened in.
pub type InteractionTeam {
InteractionTeam(
id: String,
domain: option.Option(String),
enterprise_id: option.Option(String),
enterprise_name: option.Option(String),
)
}
Constructors
-
InteractionTeam( id: String, domain: option.Option(String), enterprise_id: option.Option(String), enterprise_name: option.Option(String), )Arguments
- id
-
The workspace ID.
- domain
-
The slack.com subdomain of the workspace.
- enterprise_id
-
On Enterprise organizations, the ID of the org.
- enterprise_name
-
On Enterprise organizations, the name of the org.
The user who triggered an interaction.
pub type InteractionUser {
InteractionUser(
id: String,
username: option.Option(String),
name: option.Option(String),
team_id: option.Option(String),
)
}
Constructors
-
InteractionUser( id: String, username: option.Option(String), name: option.Option(String), team_id: option.Option(String), )Arguments
- id
-
The user ID.
- username
-
The user’s handle.
- name
-
The user’s name (deprecated in favor of
id). - team_id
-
The user’s workspace, or an enterprise ID (starting with
E) on Enterprise organizations.
Legacy: a message button or menu in a secondary attachment was used, or
an attachment menu with data_source: external needs options (then
name and value are set instead of actions).
https://docs.slack.dev/legacy/legacy-messaging/legacy-interactive-message-field-guide#action_payload
pub type InteractiveMessagePayload {
InteractiveMessagePayload(
actions: option.Option(List(LegacyAction)),
callback_id: String,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
channel: option.Option(InteractionChannel),
user: InteractionUser,
action_ts: option.Option(String),
message_ts: option.Option(String),
attachment_id: option.Option(String),
token: option.Option(String),
is_app_unfurl: option.Option(Bool),
original_message: option.Option(message.Message),
response_url: option.Option(String),
trigger_id: option.Option(String),
name: option.Option(String),
value: option.Option(String),
)
}
Constructors
-
InteractiveMessagePayload( actions: option.Option(List(LegacyAction)), callback_id: String, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), channel: option.Option(InteractionChannel), user: InteractionUser, action_ts: option.Option(String), message_ts: option.Option(String), attachment_id: option.Option(String), token: option.Option(String), is_app_unfurl: option.Option(Bool), original_message: option.Option(message.Message), response_url: option.Option(String), trigger_id: option.Option(String), name: option.Option(String), value: option.Option(String), )Arguments
- actions
-
The actions that were clicked. Only one action is sent per invocation.
- callback_id
-
The
callback_idof the attachment that contained the action. - team
-
The workspace where this action occurred.
- enterprise
-
The enterprise the installed app is part of, if any.
- is_enterprise_install
-
Whether the app is installed at the org level.
- channel
-
The channel housing the originating message.
- user
-
The user who invoked the action.
- action_ts
-
When the action occurred.
- message_ts
-
When the message containing the action was posted.
- attachment_id
-
A 1-indexed identifier for the attachment within the message, as a string.
- token
-
A deprecated verification token.
- is_app_unfurl
-
Whether the message is an app unfurl.
- original_message
-
The original message that triggered this action. Not provided for ephemeral messages.
- response_url
-
A URL used to respond to this invocation.
- trigger_id
-
A short-lived ID that can be used to open modals or dialogs.
- name
-
Options load requests only: the name of the message menu being invoked.
- value
-
Options load requests only: what the user typed into the menu.
An interactivity context, as passed between functions. https://docs.slack.dev/reference/types/interactivity-type
pub type Interactivity {
Interactivity(
interactor: option.Option(Interactor),
interactivity_pointer: option.Option(String),
)
}
Constructors
-
Interactivity( interactor: option.Option(Interactor), interactivity_pointer: option.Option(String), )Arguments
- interactor
-
The user who initiated the interactivity.
- interactivity_pointer
-
A pointer used to confirm user-initiated interactivity in a function.
The user who initiated an interactivity.
pub type Interactor {
Interactor(id: String, secret: option.Option(String))
}
Constructors
-
Interactor(id: String, secret: option.Option(String))
Legacy: an action from an interactive message attachment.
pub type LegacyAction {
LegacyAction(
name: option.Option(String),
value: option.Option(String),
action_type: option.Option(String),
selected_options: option.Option(List(LegacySelectedOption)),
)
}
Constructors
-
LegacyAction( name: option.Option(String), value: option.Option(String), action_type: option.Option(String), selected_options: option.Option(List(LegacySelectedOption)), )Arguments
- name
-
The
nameset on the originating action. - value
-
The
valueset on the originating button. - action_type
-
buttonorselect. - selected_options
-
For message menus, the selected option.
Legacy: an option chosen from a message menu.
pub type LegacySelectedOption {
LegacySelectedOption(value: String)
}
Constructors
-
LegacySelectedOption(value: String)
Sent when a user runs a message shortcut from the message context menu.
pub type MessageShortcutPayload {
MessageShortcutPayload(
callback_id: String,
trigger_id: option.Option(String),
response_url: option.Option(String),
user: InteractionUser,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
channel: option.Option(InteractionChannel),
message: option.Option(message.Message),
message_ts: option.Option(String),
token: option.Option(String),
action_ts: option.Option(String),
)
}
Constructors
-
MessageShortcutPayload( callback_id: String, trigger_id: option.Option(String), response_url: option.Option(String), user: InteractionUser, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), channel: option.Option(InteractionChannel), message: option.Option(message.Message), message_ts: option.Option(String), token: option.Option(String), action_ts: option.Option(String), )Arguments
- callback_id
-
The ID defined when creating the shortcut.
- trigger_id
-
A temporary ID that can be used to open modals.
- response_url
-
A temporary webhook that can be used to send messages in response.
- user
-
The user who initiated the shortcut.
- team
-
The workspace the shortcut was initiated in.
- enterprise
-
The enterprise the installed app is part of, if any.
- is_enterprise_install
-
Whether the app is installed at the org level.
- channel
-
The channel that the source message was located in.
- message
-
The message that the user initiated the shortcut from.
- message_ts
-
The
tsof the source message. - token
-
A deprecated verification token.
- action_ts
-
When the shortcut was used.
The body an app returns to a block_suggestion payload. Send either
options or option_groups, at most 100 of either.
https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element#external_select
pub type OptionsResponse {
OptionsResponse(
options: option.Option(List(block.SelectOption)),
option_groups: option.Option(List(block.OptionGroup)),
)
}
Constructors
-
OptionsResponse( options: option.Option(List(block.SelectOption)), option_groups: option.Option(List(block.OptionGroup)), )
A message posted to a response_url, or returned in the body of a slash
command response.
https://docs.slack.dev/interactivity/handling-user-interaction#message_responses
pub type ResponseMessage {
ResponseMessage(
text: option.Option(String),
blocks: option.Option(List(block.Block)),
attachments: option.Option(List(attachment.Attachment)),
response_type: option.Option(ResponseType),
replace_original: option.Option(Bool),
delete_original: option.Option(Bool),
thread_ts: option.Option(String),
mrkdwn: option.Option(Bool),
)
}
Constructors
-
ResponseMessage( text: option.Option(String), blocks: option.Option(List(block.Block)), attachments: option.Option(List(attachment.Attachment)), response_type: option.Option(ResponseType), replace_original: option.Option(Bool), delete_original: option.Option(Bool), thread_ts: option.Option(String), mrkdwn: option.Option(Bool), )Arguments
- text
-
The message text. Used as the fallback when
blocksare present. - blocks
-
Block Kit blocks.
- attachments
-
Legacy secondary attachments.
- response_type
-
in_channelorephemeral(the default). - replace_original
-
Replace the message the interaction came from.
- delete_original
-
Delete the message the interaction came from. Not supported for slash commands.
- thread_ts
-
Post as a reply in this thread (with
response_type: in_channel). - mrkdwn
-
Whether
textuses mrkdwn formatting.
Where a response_url message is shown.
pub type ResponseType {
InChannel
Ephemeral
}
Constructors
-
InChannelVisible to everyone in the conversation.
-
EphemeralVisible only to the user who interacted (the default).
A response_url generated for a modal element with response_url_enabled.
pub type ResponseUrl {
ResponseUrl(
block_id: option.Option(String),
action_id: option.Option(String),
channel_id: option.Option(String),
response_url: String,
)
}
Constructors
-
ResponseUrl( block_id: option.Option(String), action_id: option.Option(String), channel_id: option.Option(String), response_url: String, )Arguments
- block_id
-
The block that contained the element.
- action_id
-
The element that generated the URL.
- channel_id
-
Where the
response_urlwill publish to. - response_url
-
The webhook URL.
Received when a user dismisses a modal created with notify_on_close: true.
https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_closed
pub type ViewClosedPayload {
ViewClosedPayload(
user: InteractionUser,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
api_app_id: option.Option(String),
token: option.Option(String),
view: view.View,
is_cleared: option.Option(Bool),
function_data: option.Option(FunctionData),
interactivity: option.Option(Interactivity),
bot_access_token: option.Option(String),
)
}
Constructors
-
ViewClosedPayload( user: InteractionUser, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), api_app_id: option.Option(String), token: option.Option(String), view: view.View, is_cleared: option.Option(Bool), function_data: option.Option(FunctionData), interactivity: option.Option(Interactivity), bot_access_token: option.Option(String), )Arguments
- user
-
The user who dismissed the modal.
- team
-
The workspace that the interaction happened in.
- enterprise
-
The enterprise the installed app is part of, if any.
- is_enterprise_install
-
Whether the app is installed at the org level.
- api_app_id
-
A string representing the app ID.
- token
-
A deprecated verification token.
- view
-
The source modal view that the user dismissed, excluding input blocks.
- is_cleared
-
Whether the whole view stack was cleared.
- function_data
-
Metadata about the function execution (functions only).
- interactivity
-
An interactivity object (functions only).
- bot_access_token
-
A workflow (just-in-time) token (functions only).
Received when a user submits a modal.
Respond with a ViewSubmissionResponse or an empty 200.
https://docs.slack.dev/reference/interaction-payloads/view-interactions-payload#view_submission
pub type ViewSubmissionPayload {
ViewSubmissionPayload(
user: InteractionUser,
team: option.Option(InteractionTeam),
enterprise: option.Option(InteractionEnterprise),
is_enterprise_install: option.Option(Bool),
api_app_id: option.Option(String),
token: option.Option(String),
trigger_id: option.Option(String),
view: view.View,
hash: option.Option(String),
response_urls: option.Option(List(ResponseUrl)),
function_data: option.Option(FunctionData),
interactivity: option.Option(Interactivity),
bot_access_token: option.Option(String),
)
}
Constructors
-
ViewSubmissionPayload( user: InteractionUser, team: option.Option(InteractionTeam), enterprise: option.Option(InteractionEnterprise), is_enterprise_install: option.Option(Bool), api_app_id: option.Option(String), token: option.Option(String), trigger_id: option.Option(String), view: view.View, hash: option.Option(String), response_urls: option.Option(List(ResponseUrl)), function_data: option.Option(FunctionData), interactivity: option.Option(Interactivity), bot_access_token: option.Option(String), )Arguments
- user
-
The user who submitted the view.
- team
-
The workspace the view was submitted from. Null if the app is org-installed.
- enterprise
-
The enterprise the installed app is part of, if any.
- is_enterprise_install
-
Whether the app is installed at the org level.
- api_app_id
-
A string representing the app ID.
- token
-
A deprecated verification token.
- trigger_id
-
A short-lived ID that can be used to open modals.
- view
-
The source view of the modal the user submitted.
view.state.valuesholds the submitted values. - hash
-
A value accepted by
views.updateandviews.publish. - response_urls
-
Present when the view contained elements with
response_url_enabled. - function_data
-
Metadata about the function execution (functions only).
- interactivity
-
An interactivity object generated as a result of the view submission (functions only).
- bot_access_token
-
A workflow (just-in-time) token (functions only).
The body an app returns to a view_submission payload, on
response_action.
https://docs.slack.dev/surfaces/modals#updating_response
pub type ViewSubmissionResponse {
ErrorsResponse(errors: dict.Dict(String, String))
UpdateResponse(view: view.View)
PushResponse(view: view.View)
ClearResponse
UnknownViewSubmissionResponse(
response_action: String,
raw: value.Value,
)
}
Constructors
-
ErrorsResponse(errors: dict.Dict(String, String))Show validation errors, keyed by the
block_idof the input block. -
UpdateResponse(view: view.View)Replace the submitted view.
-
PushResponse(view: view.View)Push a new view onto the stack.
-
ClearResponseClose every view in the stack.
-
UnknownViewSubmissionResponse( response_action: String, raw: value.Value, )A
response_actionthat this version of slackline does not know.rawholds the full json.
Values
pub fn action_id(action: BlockAction) -> option.Option(String)
The action_id of a block action. For an action type that this version
of slackline does not know, it reads action_id from the raw json.
pub fn block_action_decoder() -> decode.Decoder(BlockAction)
Decodes BlockAction from json. The type field selects the variant.
pub fn block_action_to_json(it: BlockAction) -> json.Json
Encodes BlockAction as json.
pub fn block_actions_payload_decoder() -> decode.Decoder(
BlockActionsPayload,
)
Decodes BlockActionsPayload from json.
pub fn block_actions_payload_to_json(
it: BlockActionsPayload,
) -> json.Json
Encodes BlockActionsPayload as json.
pub fn block_suggestion_payload_decoder() -> decode.Decoder(
BlockSuggestionPayload,
)
Decodes BlockSuggestionPayload from json.
pub fn block_suggestion_payload_to_json(
it: BlockSuggestionPayload,
) -> json.Json
Encodes BlockSuggestionPayload as json.
pub fn clear() -> ViewSubmissionResponse
A view_submission response that closes every view in the stack.
pub fn container_decoder() -> decode.Decoder(Container)
Decodes Container from json. The type field selects the variant.
pub fn delete_original() -> ResponseMessage
A response_url message that deletes the source message.
pub fn dialog_cancellation_payload_decoder() -> decode.Decoder(
DialogCancellationPayload,
)
Decodes DialogCancellationPayload from json.
pub fn dialog_cancellation_payload_to_json(
it: DialogCancellationPayload,
) -> json.Json
Encodes DialogCancellationPayload as json.
pub fn dialog_error_decoder() -> decode.Decoder(DialogError)
Decodes DialogError from json.
pub fn dialog_error_to_json(it: DialogError) -> json.Json
Encodes DialogError as json.
pub fn dialog_errors_response_decoder() -> decode.Decoder(
DialogErrorsResponse,
)
Decodes DialogErrorsResponse from json.
pub fn dialog_errors_response_to_json(
it: DialogErrorsResponse,
) -> json.Json
Encodes DialogErrorsResponse as json.
pub fn dialog_option_decoder() -> decode.Decoder(DialogOption)
Decodes DialogOption from json.
pub fn dialog_option_group_decoder() -> decode.Decoder(
DialogOptionGroup,
)
Decodes DialogOptionGroup from json.
pub fn dialog_option_group_to_json(
it: DialogOptionGroup,
) -> json.Json
Encodes DialogOptionGroup as json.
pub fn dialog_option_to_json(it: DialogOption) -> json.Json
Encodes DialogOption as json.
pub fn dialog_options_response_decoder() -> decode.Decoder(
DialogOptionsResponse,
)
Decodes DialogOptionsResponse from json.
pub fn dialog_options_response_to_json(
it: DialogOptionsResponse,
) -> json.Json
Encodes DialogOptionsResponse as json.
pub fn dialog_submission_payload_decoder() -> decode.Decoder(
DialogSubmissionPayload,
)
Decodes DialogSubmissionPayload from json.
pub fn dialog_submission_payload_to_json(
it: DialogSubmissionPayload,
) -> json.Json
Encodes DialogSubmissionPayload as json.
pub fn dialog_suggestion_payload_decoder() -> decode.Decoder(
DialogSuggestionPayload,
)
Decodes DialogSuggestionPayload from json.
pub fn dialog_suggestion_payload_to_json(
it: DialogSuggestionPayload,
) -> json.Json
Encodes DialogSuggestionPayload as json.
pub fn envelope_payload_decoder() -> decode.Decoder(Interaction)
Decodes the payload field of a Socket Mode interactive envelope.
pub fn ephemeral(text: String) -> ResponseMessage
A text message only the user who interacted can see.
pub fn errors(
errors: List(#(String, String)),
) -> ViewSubmissionResponse
A view_submission response that shows errors on the input blocks,
given as #(block_id, message) pairs.
pub fn function_data_decoder() -> decode.Decoder(FunctionData)
Decodes FunctionData from json.
pub fn function_data_to_json(it: FunctionData) -> json.Json
Encodes FunctionData as json.
pub fn function_ref_decoder() -> decode.Decoder(FunctionRef)
Decodes FunctionRef from json.
pub fn function_ref_to_json(it: FunctionRef) -> json.Json
Encodes FunctionRef as json.
pub fn global_shortcut_payload_decoder() -> decode.Decoder(
GlobalShortcutPayload,
)
Decodes GlobalShortcutPayload from json.
pub fn global_shortcut_payload_to_json(
it: GlobalShortcutPayload,
) -> json.Json
Encodes GlobalShortcutPayload as json.
pub fn in_channel(text: String) -> ResponseMessage
A text message everyone in the conversation can see.
pub fn interaction_channel_decoder() -> decode.Decoder(
InteractionChannel,
)
Decodes InteractionChannel from json.
pub fn interaction_channel_to_json(
it: InteractionChannel,
) -> json.Json
Encodes InteractionChannel as json.
pub fn interaction_decoder() -> decode.Decoder(Interaction)
Decodes Interaction from json. The type field selects the variant.
pub fn interaction_enterprise_decoder() -> decode.Decoder(
InteractionEnterprise,
)
Decodes InteractionEnterprise from json.
pub fn interaction_enterprise_to_json(
it: InteractionEnterprise,
) -> json.Json
Encodes InteractionEnterprise as json.
pub fn interaction_team_decoder() -> decode.Decoder(
InteractionTeam,
)
Decodes InteractionTeam from json.
pub fn interaction_team_to_json(it: InteractionTeam) -> json.Json
Encodes InteractionTeam as json.
pub fn interaction_to_json(it: Interaction) -> json.Json
Encodes Interaction as json.
pub fn interaction_user_decoder() -> decode.Decoder(
InteractionUser,
)
Decodes InteractionUser from json.
pub fn interaction_user_to_json(it: InteractionUser) -> json.Json
Encodes InteractionUser as json.
pub fn interactive_message_payload_decoder() -> decode.Decoder(
InteractiveMessagePayload,
)
Decodes InteractiveMessagePayload from json.
pub fn interactive_message_payload_to_json(
it: InteractiveMessagePayload,
) -> json.Json
Encodes InteractiveMessagePayload as json.
pub fn interactivity_decoder() -> decode.Decoder(Interactivity)
Decodes Interactivity from json.
pub fn interactivity_to_json(it: Interactivity) -> json.Json
Encodes Interactivity as json.
pub fn interactor_decoder() -> decode.Decoder(Interactor)
Decodes Interactor from json.
pub fn interactor_to_json(it: Interactor) -> json.Json
Encodes Interactor as json.
pub fn legacy_action_decoder() -> decode.Decoder(LegacyAction)
Decodes LegacyAction from json.
pub fn legacy_action_to_json(it: LegacyAction) -> json.Json
Encodes LegacyAction as json.
pub fn legacy_selected_option_decoder() -> decode.Decoder(
LegacySelectedOption,
)
Decodes LegacySelectedOption from json.
pub fn legacy_selected_option_to_json(
it: LegacySelectedOption,
) -> json.Json
Encodes LegacySelectedOption as json.
pub fn message_shortcut_payload_decoder() -> decode.Decoder(
MessageShortcutPayload,
)
Decodes MessageShortcutPayload from json.
pub fn message_shortcut_payload_to_json(
it: MessageShortcutPayload,
) -> json.Json
Encodes MessageShortcutPayload as json.
pub fn option_groups(
groups: List(block.OptionGroup),
) -> OptionsResponse
A block_suggestion response listing option groups.
pub fn options(
options: List(block.SelectOption),
) -> OptionsResponse
A block_suggestion response listing options.
pub fn options_response_decoder() -> decode.Decoder(
OptionsResponse,
)
Decodes OptionsResponse from json.
pub fn options_response_to_json(it: OptionsResponse) -> json.Json
Encodes OptionsResponse as json.
pub fn parse(
payload: String,
) -> Result(Interaction, json.DecodeError)
Parses the json in the payload form field of an interactivity request.
pub fn push(view: view.View) -> ViewSubmissionResponse
A view_submission response that pushes a new view onto the stack.
pub fn response_message() -> ResponseMessage
An empty response_url message. Set fields with record update syntax.
pub fn response_message_decoder() -> decode.Decoder(
ResponseMessage,
)
Decodes ResponseMessage from json.
pub fn response_message_to_json(it: ResponseMessage) -> json.Json
Encodes ResponseMessage as json.
pub fn response_type_decoder() -> decode.Decoder(ResponseType)
Decodes ResponseType from a json string.
pub fn response_type_from_string(
string: String,
) -> Result(ResponseType, Nil)
Parses ResponseType from its json string.
pub fn response_type_to_json(it: ResponseType) -> json.Json
Encodes ResponseType as a json string.
pub fn response_type_to_string(it: ResponseType) -> String
The json string of ResponseType.
pub fn response_url_decoder() -> decode.Decoder(ResponseUrl)
Decodes ResponseUrl from json.
pub fn response_url_to_json(it: ResponseUrl) -> json.Json
Encodes ResponseUrl as json.
pub fn update(view: view.View) -> ViewSubmissionResponse
A view_submission response that replaces the submitted view.
pub fn view_closed_payload_decoder() -> decode.Decoder(
ViewClosedPayload,
)
Decodes ViewClosedPayload from json.
pub fn view_closed_payload_to_json(
it: ViewClosedPayload,
) -> json.Json
Encodes ViewClosedPayload as json.
pub fn view_submission_payload_decoder() -> decode.Decoder(
ViewSubmissionPayload,
)
Decodes ViewSubmissionPayload from json.
pub fn view_submission_payload_to_json(
it: ViewSubmissionPayload,
) -> json.Json
Encodes ViewSubmissionPayload as json.
pub fn view_submission_response_decoder() -> decode.Decoder(
ViewSubmissionResponse,
)
Decodes ViewSubmissionResponse from json. The response_action field selects the variant.
pub fn view_submission_response_to_json(
it: ViewSubmissionResponse,
) -> json.Json
Encodes ViewSubmissionResponse as json.