From 51eb2f90b983ae53f5116c2a7bfab07875efd133 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 3 Aug 2018 18:38:26 +0200 Subject: [PATCH] Add support for editing photousing file IDs --- .../methods/messages/edit_message_media.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pyrogram/client/methods/messages/edit_message_media.py b/pyrogram/client/methods/messages/edit_message_media.py index 35c24f1a..d79ecfbe 100644 --- a/pyrogram/client/methods/messages/edit_message_media.py +++ b/pyrogram/client/methods/messages/edit_message_media.py @@ -16,9 +16,12 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . +import binascii import os +import struct from pyrogram.api import functions, types +from pyrogram.api.errors import FileIdInvalid from pyrogram.client.ext import BaseClient, utils from pyrogram.client.types import ( InputMediaPhoto @@ -55,6 +58,28 @@ class EditMessageMedia(BaseClient): media = types.InputMediaPhotoExternal( url=media.media ) + else: + try: + decoded = utils.decode(media.media) + fmt = " 24 else "