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 thehtml 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>
Links and References
<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 likestart,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>. Supportsbordered,striped,compactattributes on<table>, andcolspan/rowspan/align/valignon 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 themarkdown field in rich_message.
- Bold:
**text**or__text__ - Italic:
*text*or_text_ - Strikethrough:
~~text~~ - Code:
`inline code`orpython code - Marked:
==text== - Spoiler:
||text|| - Links:
[text](URL) - Mentions:
[user](tg://user?id=1234) - Math:
$x^2$or$$E=mc^2$$ormath E=mc^2 - Tables: Standard Markdown tables
- Footnotes:
Text[^1]and[^1]: Definition - Media:
 - 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 callsendRichMessage when generation finishes to persist it.
BLP Example
<tg-thinking>Thinking...</tg-thinking> shows a native Telegram thinking animation).