Cleanup converting to input media in send album

This commit is contained in:
Lonami Exo 2019-02-25 18:25:49 +01:00
parent 8e36c0002b
commit 5b098a909a

View File

@ -302,9 +302,10 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
r = await self(functions.messages.UploadMediaRequest( r = await self(functions.messages.UploadMediaRequest(
entity, media=fm entity, media=fm
)) ))
fm = utils.get_input_photo(r.photo) self.session.cache_file(
self.session.cache_file(fh.md5, fh.size, fm) fh.md5, fh.size, utils.get_input_photo(r.photo))
fm = types.InputMediaPhoto(fm)
fm = utils.get_input_media(r.photo)
if captions: if captions:
caption, msg_entities = captions.pop() caption, msg_entities = captions.pop()