GitHub

API reference for chat_ui.

The plain elements of buttons, selects and modals (Effect's effect/chat/ChatUi).

These are what goes on the wire, into ChatTest and into storage: every element is a schema class and every value in one is already a string. chat_interaction holds the typed definitions that build them and receive their clicks; a consumer that routes clicks itself builds them directly.

  • post and edit take a flat list of Action beside the Markdown, and the adapter lays out the rows.
  • Text in a modal is plain, not Markdown: a Slack modal cannot hold a markdown block.

Values

AttributeTypeDescription
BUTTON_STYLELiteralsSchema[Literal['default', 'primary', 'danger']]
ACTIONS.Bottom[Action]
MODAL_ELEMENTS.Bottom[ModalElement]

Types

TypeDefinitionDescription
ButtonStyletype ButtonStyle = Literal['default', 'primary', 'danger']
Actiontype Action = Button | LinkButton | Select

What post and edit take in actions.

ModalElementtype ModalElement = TextInput | SelectInput | Text

One element of a modal.

Classes

Functions

link_button(*, label, url) -> LinkButton

A button that opens url, to put a link beside a message's buttons. It is the one element with no definition in chat_interaction, since it produces no click.

ParameterTypeDescription
labelstr
urlstr

Returns LinkButton

def link_button(*, label: str, url: str) -> LinkButton:
    """A button that opens ``url``, to put a link beside a message's
    buttons. It is the one element with no definition in
    ``chat_interaction``, since it produces no click."""
    return LinkButton(label=label, url=url)