compose_rich_message_with_ai()

Client.compose_rich_message_with_ai()

Compose or improve a rich message using Telegram’s AI.

Usable by Users Bots
Parameters:
  • proofread (bool, optional) – Pass True to proofread and improve the existing text. Defaults to False.

  • text (InputRichMessage, optional) – The rich message input to compose or proofread.

  • translate_to_lang (str, optional) – Target language code for AI-assisted translation.

  • tone (InputAiComposeTone, optional) – The composition tone/style to apply.

Returns:

ComposedRichMessageWithAI – The AI-composed message.

Example

result = await app.compose_rich_message_with_ai(
    proofread=True,
    text=raw.types.InputRichMessage(blocks=[...])
)