pyrofork: fix Message.translate docs

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-09-02 20:27:44 +07:00
parent d9c6286044
commit 489337d5d0
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 15 additions and 7 deletions

View file

@ -748,6 +748,7 @@ def pyrogram_api():
Message.reply_web_page Message.reply_web_page
Message.get_media_group Message.get_media_group
Message.react Message.react
Message.translate
Message.wait_for_click Message.wait_for_click
""", """,
chat=""" chat="""

View file

@ -5290,22 +5290,29 @@ class Message(Object, Update):
to_language_code: str to_language_code: str
) -> "types.TranslatedText": ) -> "types.TranslatedText":
"""Bound method *translate* of :obj:`~pyrogram.types.Message`. """Bound method *translate* of :obj:`~pyrogram.types.Message`.
Use as a shortcut for: Use as a shortcut for:
.. code-block:: python .. code-block:: python
await client.translate_message_text( await client.translate_message_text(
chat_id=message.chat.id, chat_id=message.chat.id,
message_ids=message_id, message_ids=message_id,
to_language_code="en" to_language_code="en"
) )
Example: Example:
.. code-block:: python .. code-block:: python
await message.translate("en")
await Message.translate("en")
Parameters: Parameters:
to_language_code (``str``): to_language_code (``str``):
Language code of the language to which the message is translated. Language code of the language to which the message is translated.
Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu". Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu".
Returns: Returns:
:obj:`~pyrogram.types.TranslatedText`: The translated result is returned. :obj:`~pyrogram.types.TranslatedText`: The translated result is returned.
Raises: Raises:
RPCError: In case of a Telegram RPC error. RPCError: In case of a Telegram RPC error.
""" """