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:
| UpdateShort | UpdateShortChatMessage |
| UpdateShortMessage | UpdateShortSentMessage |
| Updates | UpdatesCombined |
| UpdatesTooLong |
Parameters
| receiver_id | InputUser | Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.). |
| id | int | |
| invert_media | flag | This argument defaults to None and can be omitted. |
| welcome | flag | This argument defaults to None and can be omitted. |
| peer | InputPeer | This 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.). |
| message | string | This argument defaults to None and can be omitted. |
| media | InputMedia | This argument defaults to None and can be omitted. |
| entities | MessageEntity | This argument defaults to None and can be omitted. Otherwise, a list must be supplied. |
| reply_markup | ReplyMarkup | This argument defaults to None and can be omitted. |
| rich_message | InputRichMessage | This 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())