sendMessageDraft()
Use this method to stream a partial 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 sendMessage with the complete message to persist it in the user's chat. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
chat_id | number | required | Unique identifier for the target private chat |
message_thread_id | number | optional | Unique identifier for the target message thread |
draft_id | number | required | Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. |
text | string | optional | Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a “Thinking…” placeholder. |
parse_mode | string | optional | Mode for parsing entities in the message text. See formatting options for more details. |
entities | MessageEntity[] | optional | A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode |
returns
boolean
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { SendMessageDraftParams } from "@yaebal/types";
await bot.api.call<boolean>("sendMessageDraft", {
chat_id: 123456789,
draft_id: 1,
} satisfies SendMessageDraftParams);context shortcut
also available as ctx.sendMessageDraft() on
16
context types — see @yaebal/contexts.
/** Use this method to stream a partial 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 [sendMessage](https://core.telegram.org/bots/api/#sendmessage) with the complete message to persist it in the user's chat. Returns *True* on success. */
ctx.sendMessageDraft(params: Omit<SendMessageDraftParams, "chat_id">)official Bot API docs: https://core.telegram.org/bots/api/#sendmessagedraft