sendRichMessageDraft
Streams a partial rich message — a 30-second preview (Bot API 10.1).
Returns: On success, returns True.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Private chat ID |
message_thread_id | Integer | Optional | Topic ID (for forums) |
draft_id | Integer | Yes | Unique draft ID (non-zero) |
rich_message | InputRichMessage | Yes | JSON InputRichMessage object — partial message to stream |
can_stop | Boolean | Optional | Show a button to stop further drafts (Bot API 10.3) |
keep_on_stop | Boolean | Optional | Keep the draft in the chat when the stop button is pressed (Bot API 10.3) |
Example request
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendRichMessageDraft" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"draft_id": 1,
"rich_message": {
"markdown": "**Hello** from a rich message"
}
}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/sendRichMessageDraft",
json={
"chat_id": 123456789,
"draft_id": 1,
"rich_message": {
"markdown": "**Hello** from a rich message"
}
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendRichMessageDraft`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"draft_id": 1,
"rich_message": {
"markdown": "**Hello** from a rich message"
}
}),
});
console.log(await res.json());
Step-by-step guide: Telegram Bot API 10.0–10.3: Rich Messages, Ephemeral Messages, Guest Mode and More
Related methods
sendRichMessageSends a rich message with structured formatting (Bot API 10.1).