sendRichMessageDraft
Streams partial rich messages as temporary 30-second draft previews during generation. Send the complete message afterward to persist the final chat content.
Instructions
Use this method to stream a partial rich message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you must call sendRichMessage with the complete message to persist it in the user's chat. Returns True on success.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chat_id": "<chat_id>",
"draft_id": "<draft_id>",
"rich_message": "<rich_message>"
},
"name": "sendRichMessageDraft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Unique identifier for the target private chat | |
| can_stop | No | Pass True to show the user a button to stop further drafts. The bot will receive an Update “stopped_message_generation” if the user presses the button. | |
| draft_id | Yes | Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. | |
| keep_on_stop | No | Pass True to keep the draft in the chat when the button is pressed. The draft will still disappear after a short time or if the bot sends a message. To fully preserve the partial draft, the bot should send it as a new message. | |
| rich_message | Yes | The partial message to be streamed | |
| message_thread_id | No | Unique identifier for the target message thread |