peyk.platforms.telegram.methods.send_message_draft

async peyk.platforms.telegram.methods.send_message_draft(self, chat_id: int, draft_id: int | None = None, *, message_thread_id: int | None = None, text: str | None = None, parse_mode: str | None = None, entities: List[MessageEntity] | None = None, can_stop: bool | None = None, keep_on_stop: bool | None = None) bool

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:
  • chat_id – Unique identifier for the target private chat

  • draft_id – Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated.

  • message_thread_id – Unique identifier for the target message thread

  • text – Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a ‘Thinking…’ placeholder.

  • parse_mode – Mode for parsing entities in the message text. See formatting options for more details.

  • entities – A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

  • can_stop – Value accepted by this operation.

  • keep_on_stop – Value accepted by this operation.

Returns:

Result returned by Telegram on successful execution.

Return type:

bool