Nadia.InputRichBlock (nadia v1.7.0)

View Source

Typed builders for Telegram InputRichBlock objects.

One constructor exists per official block type. Each builder fixes the Telegram type discriminator, omits nil options, and preserves explicit false values. Blocks compose: list/2 items, details/2 content, collage/2 and slideshow/2 items, table/2 and buttons/2 rows, and expandable_block_quotation/2 and section_heading/2 content accept both plain maps and values built in this module. Telegram enforces nesting and structural limits; Nadia validates types locally.

Summary

Types

t()

A typed Telegram InputRichBlock value. Its representation is opaque.

Functions

Builds an anchor block.

Builds an audio media block. media is an Nadia.InputMedia value or map.

Builds a block quotation block.

Builds a buttons block. rows is a list of lists of button maps (RichMessageButton-shaped) or Nadia.Model.InlineKeyboardButton values.

Builds a collage block of InputMedia values.

Builds a details (collapsible) block.

Builds a divider block.

Builds an expandable block quotation block.

Builds a footer block.

Builds a list block of InputRichBlockListItem values.

Builds a map location block.

Builds an animation media block. media is an Nadia.InputMedia value or map.

Builds a mathematical expression block.

Builds a text paragraph block.

Builds a photo media block. media is an Nadia.InputMedia value or map.

Builds a preformatted code block.

Builds a pull quotation block.

Builds a section heading block.

Builds a slideshow block of InputMedia values.

Builds a table block. rows is a list of row lists; each cell is a plain map or a value built in this module.

Builds a thinking block, allowed in drafts only.

Builds a video media block. media is an Nadia.InputMedia value or map.

Builds a voice-note media block. media is an Nadia.InputMedia value or map.

Types

options()

@type options() :: keyword() | map()

t()

@opaque t()

A typed Telegram InputRichBlock value. Its representation is opaque.

type()

@type type() ::
  :paragraph
  | :section_heading
  | :preformatted
  | :footer
  | :divider
  | :mathematical_expression
  | :anchor
  | :list
  | :block_quotation
  | :pull_quotation
  | :expandable_block_quotation
  | :collage
  | :slideshow
  | :table
  | :details
  | :map
  | :animation
  | :audio
  | :photo
  | :video
  | :voice_note
  | :thinking
  | :buttons

Functions

anchor(name)

@spec anchor(binary()) :: t()

Builds an anchor block.

audio_media(media, options \\ [])

@spec audio_media(term(), options()) :: t()

Builds an audio media block. media is an Nadia.InputMedia value or map.

block_quotation(text, options \\ [])

@spec block_quotation(term(), options()) :: t()

Builds a block quotation block.

buttons(rows, options \\ [])

@spec buttons(list(), options()) :: t()

Builds a buttons block. rows is a list of lists of button maps (RichMessageButton-shaped) or Nadia.Model.InlineKeyboardButton values.

collage(items, options \\ [])

@spec collage(list(), options()) :: t()

Builds a collage block of InputMedia values.

details(title, content, options \\ [])

@spec details(term(), list(), options()) :: t()

Builds a details (collapsible) block.

content is a list of blocks; title is a plain map or rich text value built in this module.

divider()

@spec divider() :: t()

Builds a divider block.

expandable_block_quotation(text, options \\ [])

@spec expandable_block_quotation(term(), options()) :: t()

Builds an expandable block quotation block.

footer(text, options \\ [])

@spec footer(term(), options()) :: t()

Builds a footer block.

list(items, options \\ [])

@spec list(list(), options()) :: t()

Builds a list block of InputRichBlockListItem values.

map(latitude, longitude, options \\ [])

@spec map(float(), float(), options()) :: t()

Builds a map location block.

map_media(media, options \\ [])

@spec map_media(term(), options()) :: t()

Builds an animation media block. media is an Nadia.InputMedia value or map.

mathematical_expression(expression, options \\ [])

@spec mathematical_expression(binary(), options()) :: t()

Builds a mathematical expression block.

paragraph(text, options \\ [])

@spec paragraph(term(), options()) :: t()

Builds a text paragraph block.

photo_media(media, options \\ [])

@spec photo_media(term(), options()) :: t()

Builds a photo media block. media is an Nadia.InputMedia value or map.

preformatted(text, options \\ [])

@spec preformatted(binary(), options()) :: t()

Builds a preformatted code block.

pull_quotation(text, options \\ [])

@spec pull_quotation(term(), options()) :: t()

Builds a pull quotation block.

section_heading(text, options \\ [])

@spec section_heading(term(), options()) :: t()

Builds a section heading block.

slideshow(items, options \\ [])

@spec slideshow(list(), options()) :: t()

Builds a slideshow block of InputMedia values.

table(rows, options \\ [])

@spec table(list(), options()) :: t()

Builds a table block. rows is a list of row lists; each cell is a plain map or a value built in this module.

thinking(options \\ [])

@spec thinking(options()) :: t()

Builds a thinking block, allowed in drafts only.

video_media(media, options \\ [])

@spec video_media(term(), options()) :: t()

Builds a video media block. media is an Nadia.InputMedia value or map.

voice_note_media(media, options \\ [])

@spec voice_note_media(term(), options()) :: t()

Builds a voice-note media block. media is an Nadia.InputMedia value or map.