Handle FloodWaitError in client.download_media

Fixes #1426. Not entirely happy with the new indirection layer,
but the original __call__ method is already a mess anyway and
the additional cost of an extra call should be neglible compared
to the actual IO.
This commit is contained in:
Lonami Exo
2020-04-28 20:49:57 +02:00
parent 7f3aa43ad4
commit 7ea4686d6c
3 changed files with 6 additions and 3 deletions

View File

@@ -1039,7 +1039,7 @@ class MessageMethods:
if exported:
try:
sender = await self._borrow_exported_sender(entity.dc_id)
return await sender.send(request)
return await self._call(sender, request)
finally:
await self._return_exported_sender(sender)
else: