mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Fix sending albums not returning the sent messages (#1151)
This commit is contained in:
parent
9598e1877c
commit
b32d8307ec
|
@ -346,11 +346,18 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
|
||||||
result = await self(functions.messages.SendMultiMediaRequest(
|
result = await self(functions.messages.SendMultiMediaRequest(
|
||||||
entity, reply_to_msg_id=reply_to, multi_media=media, silent=silent
|
entity, reply_to_msg_id=reply_to, multi_media=media, silent=silent
|
||||||
))
|
))
|
||||||
return [
|
|
||||||
self._get_response_message(update.id, result, entity)
|
# We never sent a `random_id` for the messages that resulted from
|
||||||
for update in result.updates
|
# the request so we can't pair them up with the `Updates` that we
|
||||||
if isinstance(update, types.UpdateMessageID)
|
# get from Telegram. However, the sent messages have a photo and
|
||||||
]
|
# the photo IDs match with those we did send.
|
||||||
|
#
|
||||||
|
# Updates -> {_: message}
|
||||||
|
messages = self._get_response_message(None, result, entity)
|
||||||
|
# {_: message} -> {photo ID: message}
|
||||||
|
messages = {m.photo.id: m for m in messages.values()}
|
||||||
|
# Sent photo IDs -> messages
|
||||||
|
return [messages[m.media.id.id] for m in media]
|
||||||
|
|
||||||
async def upload_file(
|
async def upload_file(
|
||||||
self, file, *, part_size_kb=None, file_name=None, use_cache=None,
|
self, file, *, part_size_kb=None, file_name=None, use_cache=None,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user