sendMessageDraft
Stream a partial message to a private chat while the bot generates the full text. Use draft IDs to animate updates and optionally let users stop generation.
Instructions
Use this method to stream a partial message to a user while the message is being generated. 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>",
"text": "<text>"
},
"name": "sendMessageDraft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text of the message to be sent, 1-4096 characters after entities parsing | |
| 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. | |
| entities | No | A list of special entities that appear in message text, which can be specified instead of parse_mode | |
| parse_mode | No | Mode for parsing entities in the message text. See formatting options for more details. | |
| 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. | |
| message_thread_id | No | Unique identifier for the target message thread |