Skip to main content
Rich messages in Telegram support advanced structured formatting options like headings, lists, tables, media collages, block quotations, collapsible blocks, footnotes, and mathematical formulas. Telegram clients will render them natively. You can specify rich message content using Markdown-style or HTML-style formatting.

sendRichMessage

Use this method to send rich messages. The BLP engine provides a straightforward way to send HTML or Markdown rich messages.
BLP Example (Basic HTML Table)
BLP Example (Advanced UI with Slideshow & Collapsible Details)

Supported HTML Tags

When using the html field in rich_message, you can use standard and custom Telegram tags:

Basic Formatting

  • <b>, <strong>, <i>, <em>, <u>, <ins>, <s>, <strike>, <del>
  • <code>, <mark>, <sub>, <sup>
  • <tg-spoiler>spoiler</tg-spoiler>
  • <a href="https://t.me/">URL</a>, <a href="tg://user?id=123456789">Mention</a>
  • <a name="chapter-1"></a> to create an anchor, <a href="#chapter-1">Go to chapter</a>
  • <tg-reference name="note-1">Referenced text</tg-reference> and link to it using <a href="#note-1">

Custom Emoji & Interactive Elements

  • <tg-emoji emoji-id="5368324170671202286">👍</tg-emoji>
  • <tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time>
  • <tg-math>x^2 + y^2</tg-math>

Structure & Layout

  • Headings: <h1> to <h6>
  • Paragraphs & Code: <p>, <pre>, <footer>, <hr/>
  • Lists: <ul>, <ol> (supports attributes like start, type, reversed)
  • Checkboxes: <input type="checkbox" checked>
  • Quotations: <blockquote>, <blockquote expandable>, <aside>

Media Elements

  • <img src="https://telegram.org/photo.jpg"/>
  • <video src="...">, <audio src="...">, <tg-document src="...">
  • Wrap media in <figure> to add a <figcaption> with <cite>.
  • Collages & Slideshows: <tg-collage>, <tg-slideshow>

Tables & Collapsible Blocks

  • Tables: <table>, <tr>, <th>, <td>. Supports bordered, striped, compact attributes on <table>, and colspan/rowspan/align/valign on cells.
  • Details: <details open><summary>Title</summary>Content</details>

Interactive Buttons

Buttons can be grouped in <p> or <tg-button-row align="center">:

Supported Markdown Syntax

To use Markdown instead, pass the markdown field in rich_message.
  • Bold: **text** or __text__
  • Italic: *text* or _text_
  • Strikethrough: ~~text~~
  • Code: `inline code` or python code
  • Marked: ==text==
  • Spoiler: ||text||
  • Links: [text](URL)
  • Mentions: [user](tg://user?id=1234)
  • Math: $x^2$ or $$E=mc^2$$ or math E=mc^2
  • Tables: Standard Markdown tables
  • Footnotes: Text[^1] and [^1]: Definition
  • Media: ![](URL "Caption")
  • Collage: <tg-collage> ... </tg-collage>
  • Slideshow: <tg-slideshow> ... </tg-slideshow>
  • Details: <details><summary>...</summary>...</details>
BLP Example

sendRichMessageDraft

Use this method to stream a partial rich message to a user while the message is being generated (like a streaming AI response). The draft is ephemeral and acts as a 30-second preview. You must call sendRichMessage when generation finishes to persist it.
BLP Example
(Note: <tg-thinking>Thinking...</tg-thinking> shows a native Telegram thinking animation).