From 8d35559f0bee7ebcba8e8bde294033020dd3e132 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 3 Aug 2018 18:37:10 +0200 Subject: [PATCH] Return the higher-level Message object instead of the raw update --- pyrogram/client/methods/messages/edit_message_media.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/methods/messages/edit_message_media.py b/pyrogram/client/methods/messages/edit_message_media.py index dfee76a8..1e42c304 100644 --- a/pyrogram/client/methods/messages/edit_message_media.py +++ b/pyrogram/client/methods/messages/edit_message_media.py @@ -19,7 +19,7 @@ import os from pyrogram.api import functions, types -from pyrogram.client.ext import BaseClient +from pyrogram.client.ext import BaseClient, utils from pyrogram.client.types import ( InputMediaPhoto ) @@ -61,3 +61,11 @@ class EditMessageMedia(BaseClient): **style.parse(caption) ) ) + + for i in r.updates: + if isinstance(i, (types.UpdateEditMessage, types.UpdateEditChannelMessage)): + return utils.parse_messages( + self, i.message, + {i.id: i for i in r.users}, + {i.id: i for i in r.chats} + )