ComposeRichMessageWithAIRequest

Both users and bots may be able to use this request. See code examples.

---functions---
messages.composeRichMessageWithAI#8d7ae6af flags:# proofread:flags.0?true emojify:flags.3?true text:flags.4?InputRichMessage translate_to_lang:flags.1?string tone:flags.2?InputAiComposeTone = messages.ComposedRichMessageWithAI

Returns

messages.ComposedRichMessageWithAI

This type can only be an instance of:

ComposedRichMessageWithAI

Parameters

proofreadflagThis argument defaults to None and can be omitted.
emojifyflagThis argument defaults to None and can be omitted.
textInputRichMessageThis argument defaults to None and can be omitted.
translate_to_langstringThis argument defaults to None and can be omitted.
toneInputAiComposeToneThis argument defaults to None and can be omitted.

Known RPC errors

This request can't cause any RPC error as far as we know.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.ComposeRichMessageWithAIRequest(
        proofread=True,
        emojify=True,
        text=types.InputRichMessage(
            blocks=[types.PageBlockUnsupported()],
            rtl=True,
            noautolink=True,
            photos=[types.InputPhoto(
                id=-12398745604826,
                access_hash=-12398745604826,
                file_reference=b'arbitrary\x7f data \xfa here'
            )],
            documents=[types.InputDocument(
                id=-12398745604826,
                access_hash=-12398745604826,
                file_reference=b'arbitrary\x7f data \xfa here'
            )],
            users=['username']
        ),
        translate_to_lang='some string here',
        tone=types.InputAiComposeToneDefault(
            tone='some string here'
        )
    ))
    print(result.stringify())