Nadia.InputRichMessage (nadia v1.6.1)

View Source

Typed builders for Telegram InputRichMessage objects.

html/2 and markdown/2 fix the selected formatting mode and validate the locally enforceable rich-message limits. Nadia validates valid UTF-8, the 32,768-character source limit, and Boolean flags. Nadia does not parse or otherwise validate HTML or Markdown formatting.

Telegram enforces up to 500 blocks, 16 nesting levels, 50 media attachments, and 20 table columns, as well as the supported syntax, block structure, media URLs and MIME types, rendering, and chat media permissions.

Telegram permits thinking blocks only in rich-message drafts. Context validation conservatively detects the case-insensitive literal <tg-thinking prefix anywhere in the source. This can reject escaped or otherwise non-tag text containing that literal because Nadia intentionally does not include an HTML or Markdown parser.

Summary

Types

t()

A typed Telegram InputRichMessage value. Its representation is opaque.

Functions

Builds a rich message described with Telegram's supported HTML formatting.

Builds a rich message described with Telegram's supported Markdown formatting.

Types

context()

@type context() :: :send | :draft | :edit | :inline_content

options()

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

t()

@opaque t()

A typed Telegram InputRichMessage value. Its representation is opaque.

Functions

html(content, options \\ [])

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

Builds a rich message described with Telegram's supported HTML formatting.

The source must be valid UTF-8 and contain at most 32,768 Unicode characters. Empty source is accepted because the Bot API does not document a non-empty minimum.

markdown(content, options \\ [])

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

Builds a rich message described with Telegram's supported Markdown formatting.

The source must be valid UTF-8 and contain at most 32,768 Unicode characters. Empty source is accepted because the Bot API does not document a non-empty minimum.