Fix send_file(force_document=True) for albums (closes #713)

This commit is contained in:
Lonami Exo 2018-03-21 09:46:57 +01:00
parent 3550974b71
commit f2407409b3

View File

@ -1399,6 +1399,9 @@ class TelegramClient(TelegramBareClient):
if utils.is_list_like(file):
# TODO Fix progress_callback
images = []
if force_document:
documents = file
else:
documents = []
for x in file:
if utils.is_image(x):
@ -1417,7 +1420,7 @@ class TelegramClient(TelegramBareClient):
result.extend(
self.send_file(
entity, x, allow_cache=False,
entity, x, allow_cache=allow_cache,
caption=caption, force_document=force_document,
progress_callback=progress_callback, reply_to=reply_to,
attributes=attributes, thumb=thumb, **kwargs