Skip to main content
Rich messages support advanced structured formatting like headings, lists, tables, media collages, block quotations, collapsible blocks, footnotes, and LaTeX formulas.
Limits:
  • Up to 32,768 UTF-8 characters in the message text
  • Up to 500 blocks (including nested blocks, list items, table rows, etc.)
  • Up to 16 levels of nesting
  • Up to 50 media attachments in total
  • Up to 20 columns in a table

sendRichMessage

Sends a rich formatted message. Use exactly one of html, markdown, or blocks in the rich_message object.
If the message contains a media block, the bot must have the right to send that media type to the chat.

InputRichMessage Fields

Exactly one of html, markdown, or blocks must be provided.

InputRichMessageMedia Fields

BLP Example (HTML Table)
BLP Example (HTML Slideshow + Details + Buttons)
BLP Example (All elements combined)

sendRichMessageDraft

Streams a partial/in-progress rich message to the user. Ideal for AI responses that appear progressively. Draft disappears after ~30 seconds. Call sendRichMessage to persist.
Note: Direct upload of new files is not supported in drafts. Use only already-uploaded file IDs.
BLP Example (AI Streaming Response)

Supported HTML Tags

Text Formatting

Structure and Layout

Lists

Ordered list type values: 1 (decimal), a (lowercase letters), A (uppercase letters), i (lowercase Roman), I (uppercase Roman).

Block Quotations

Media Blocks

Media can only be specified as a separate block (not inline). Only HTTP/HTTPS URLs are supported.

Collage and Slideshow

Tables

Collapsible Details Block

Interactive Buttons

Button types: Button styles: success (green), danger (red), primary (blue), link (borderless; only for callback_data).

Supported Markdown Syntax


Block Reference (InputRichBlock Types)

When using the blocks array, each block is a JSON object with a type field. All 24 supported block types: InputRichBlockListItem fields:
BLP Example (Using blocks array directly)

RichMessageButton Fields


Special Tags

Thinking Block (Draft Only)

Only valid inside sendRichMessageDraft. Cannot appear in sendRichMessage.
See AIActions emoji pack for recommended custom emoji for thinking blocks.

Date/Time Entities

Custom Emoji


Important Notes

  • Entity auto-detection: URLs, emails, usernames, hashtags, cashtags, bot commands, phone numbers, and bank card numbers are detected automatically. Pass skip_entity_detection: True to disable.
  • Telegram link alert: Users see an alert before opening inline links.
  • Media URL reuse: Use tg://photo?id=..., tg://video?id=..., tg://document?id=..., or tg://audio?id=... links together with the media field to embed pre-uploaded files.
  • Markdown inside HTML: Markdown is not parsed inside block HTML tags except inside <details>, <tg-collage>, and <tg-slideshow>.
  • Table cells: Support only inline formatting (no nested block elements).
  • Formula source: Treated as raw LaTeX.
  • Map constraints: Width x height must not exceed 10,000. Width-to-height ratio must be at most 20. Zoom: 0-24.
  • Button rows: Each <tg-button-row> / buttons block supports 1-8 buttons.
  • Draft-only blocks: thinking blocks can only be used in sendRichMessageDraft, not sendRichMessage.