Search code examples
telegramtelethon

How to edit message in Telegram using Telethon?


I've already learnt how to edit the message text form this https://telethonn.readthedocs.io/en/latest/telethon.html#telethon.telegram_client.TelegramClient.edit_message. But how to change photos or some other things?


Solution

  • You're checking out an unofficial version of the documentation which is very out of date. The official version is TelegramClient.edit_message, which showcases the file parameter:

    await client.edit_message(chat, msg_id, file='example.jpg')