Fix-up file to media calls from edit (from 3d72c10)

This commit is contained in:
Lonami Exo 2019-03-12 22:18:57 +01:00
parent 916b379c03
commit 9d5344e90d

View File

@ -753,7 +753,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
entity = await self.get_input_entity(entity) entity = await self.get_input_entity(entity)
text, msg_entities = await self._parse_message_text(text, parse_mode) text, msg_entities = await self._parse_message_text(text, parse_mode)
file_handle, media = await self._file_to_media(file) file_handle, media, image = await self._file_to_media(file)
request = functions.messages.EditMessageRequest( request = functions.messages.EditMessageRequest(
peer=entity, peer=entity,
id=utils.get_message_id(message), id=utils.get_message_id(message),
@ -764,7 +764,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
reply_markup=self.build_reply_markup(buttons) reply_markup=self.build_reply_markup(buttons)
) )
msg = self._get_response_message(request, await self(request), entity) msg = self._get_response_message(request, await self(request), entity)
await self._cache_media(msg, file, file_handle) await self._cache_media(msg, file, file_handle, image=image)
return msg return msg
async def delete_messages(self, entity, message_ids, *, revoke=True): async def delete_messages(self, entity, message_ids, *, revoke=True):