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 ofhtml, 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 ofhtml, 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. CallsendRichMessage 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
Links and Anchors
Structure and Layout
Lists
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 styles:
success (green), danger (red), primary (blue), link (borderless; only for callback_data).
Supported Markdown Syntax
Block Reference (InputRichBlock Types)
When using theblocks 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 insidesendRichMessageDraft. 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: Trueto 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=..., ortg://audio?id=...links together with themediafield 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>/buttonsblock supports 1-8 buttons. - Draft-only blocks:
thinkingblocks can only be used insendRichMessageDraft, notsendRichMessage.
