EditMessageRequest

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

---functions---
ephemeral.editMessage#cf9c725b flags:# invert_media:flags.5?true welcome:flags.6?true peer:flags.7?InputPeer receiver_id:InputUser id:int message:flags.0?string media:flags.3?InputMedia entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup rich_message:flags.4?InputRichMessage = Updates

Returns

Updates

This type can be an instance of either:

UpdateShortUpdateShortChatMessage
UpdateShortMessageUpdateShortSentMessage
UpdatesUpdatesCombined
UpdatesTooLong

Parameters

receiver_idInputUserAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
idint
invert_mediaflagThis argument defaults to None and can be omitted.
welcomeflagThis argument defaults to None and can be omitted.
peerInputPeerThis argument defaults to None and can be omitted. Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
messagestringThis argument defaults to None and can be omitted.
mediaInputMediaThis argument defaults to None and can be omitted.
entitiesMessageEntityThis argument defaults to None and can be omitted. Otherwise, a list must be supplied.
reply_markupReplyMarkupThis argument defaults to None and can be omitted.
rich_messageInputRichMessageThis 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.ephemeral.EditMessageRequest(
        receiver_id='username',
        id=42,
        invert_media=True,
        welcome=True,
        peer='username',
        message='Hello there!',
        media=types.InputMediaUploadedPhoto(
            file=client.upload_file('/path/to/file.jpg'),
            spoiler=True,
            live_photo=True,
            stickers=[types.InputDocument(
                id=-12398745604826,
                access_hash=-12398745604826,
                file_reference=b'arbitrary\x7f data \xfa here'
            )],
            ttl_seconds=42,
            video=types.InputDocument(
                id=-12398745604826,
                access_hash=-12398745604826,
                file_reference=b'arbitrary\x7f data \xfa here'
            )
        ),
        rich_message=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']
        )
    ))
    print(result.stringify())