translate_rich_message()

async Client.translate_rich_message()

Translate a rich message (with formatting) to another language.

Usable by Users Bots
Parameters:
  • chat_id (int | str, optional) – Unique identifier (int) or username (str) of the target chat.

  • message_id (int | List of int, optional) – The message ID(s) to translate.

  • to_lang (str) – Target language code (e.g., “en”, “ru”).

  • text (InputRichMessage | List of InputRichMessage | str | InputRichMessage, optional) – The rich message content to translate.

  • tone (str, optional) – Translation tone/style.

Returns:

RichMessage | List of RichMessage – The translated rich message(s).

Example

result = await app.translate_rich_message(chat_id, message_id, to_lang="en")