BlockBox.CompositionObjects (blockbox v1.2.1)

Defines types and generator functions for all composition objects.

Link to this section Summary

Functions

Function that generates a filter object for conversation lists.

Function that generates an option group object for select menus

Function that generates an option object for select menus

Link to this section Types

Link to this type

confirm_object()

@type confirm_object() :: %{
  title: plain_text_object(),
  text: text_object(),
  confirm: plain_text_object(),
  deny: plain_text_object()
}
Link to this type

filter_object()

@type filter_object() :: %{
  optional(:include) => [String.t()],
  optional(:exclude_external_shared_channels) => boolean(),
  optional(:exclude_bot_users) => boolean()
}
Link to this type

option_group_object()

@type option_group_object() :: %{
  label: plain_text_object(),
  options: [option_object()]
}
Link to this type

option_object()

@type option_object() :: %{
  :text => text_object(),
  :value => String.t(),
  optional(:description) => plain_text_object(),
  optional(:url) => String.t()
}
Link to this type

plain_text_object()

@type plain_text_object() :: %{
  :text => String.t(),
  :type => :plain_text,
  optional(:emoji) => boolean()
}
Link to this type

text_object()

@type text_object() :: %{
  :text => String.t(),
  :type => text_type(),
  optional(:emoji) => boolean(),
  optional(:verbatim) => boolean()
}
@type text_type() :: :plain_text | :mrkdwn

Link to this section Functions

Link to this function

confirm_object(title, text, confirm \\ "Confirm", deny \\ "Deny")

@spec confirm_object(String.t(), String.t(), String.t(), String.t()) ::
  confirm_object()

Function that generates a confirmation dialog object

Link to this function

filter_object(opts)

Function that generates a filter object for conversation lists.

All fields are optional but AT LEAST ONE MUST BE INCLUDED.

options

Options

Options are not included by default.

  • :include - non empty list of strings from the following options: "im", "mpim", "private", "public"
  • :exclude_external_shared_channels - boolean, defaults to false
  • :exclude_bot_users - boolean, defaults to false
Link to this function

option_group_object(label, options)

@spec option_group_object(String.t() | plain_text_object(), String.t()) ::
  option_group_object()

Function that generates an option group object for select menus

Link to this function

option_object(text, value, opts \\ [])

@spec option_object(String.t() | plain_text_object(), String.t(), keyword()) ::
  option_object()

Function that generates an option object for select menus

options

Options

Options are not included by default.

  • :url - boolean, only available in overflow menus
  • :description - String, max 75 chars
Link to this function

text_object(text, type \\ :plain_text, opts \\ [])

@spec text_object(String.t(), text_type(), keyword()) :: text_object()

Function that generates a text object

options

Options

Options are not included by default.

  • :emoji - boolean, only usable when type is :plain_text
  • :verbatim - boolean, only usable when type is :mrkdwn