Telethon
Telethon copied to clipboard
error when tring to use client.send_file for multiple photos
Hello,
Using Python 3.7.5 and Telethon 1.11.3.
following the example from Telethon documentation
# Albums
await client.send_file(chat, [
'/my/photos/holiday1.jpg',
'/my/photos/holiday2.jpg',
'/my/drawings/portrait.png'
])
when trying to send more than one photo using client.send_file i get "Media invalid (caused by SendMultiMediaRequest)" error.
when sending a single photo there is no error:
await client.send_file(contact, 'http://s3.amazonaws.com/tn1.app/0.png')
the error occurs when trying to send more than one photo:
await client.send_file(contact, ['http://s3.amazonaws.com/tn1.app/0.png', 'http://s3.amazonaws.com/tn1.app/2.png'])
thanks much in advance! RS
Telegram doesn't support sending albums from URLs.
thank you.
Telegram doesn't support sending albums from URLs.
@Lonami I know that Bot API supports it, are you sure that MTProto doesn't support it?
I have tried it and it did not work back when I tried. Bot API may be downloading and re-uploading behind the scenes which Telethon won't do.
Seems that this problem occur again:
when sending a single photo there is no error:
await client.send_file(contact, 'http://s3.amazonaws.com/tn1.app/0.png')
the error occurs when trying to send more than one photo:
await client.send_file(contact, ['http://s3.amazonaws.com/tn1.app/0.png', 'http://s3.amazonaws.com/tn1.app/2.png'])
But the error message sent to me is "Media invalid (caused by UploadMediaRequest)" instead of "Media invalid (caused by SendMultiMediaRequest)".
Could anyone please check what's goion wrong? Thanks so much.
I queried history, bugs may be here, I am not familiar with Python, can I fix this function as soon as possible?
https://github.com/LonamiWebs/Telethon/commit/72fc8f680817ea067b85c06c2d9223b219fd8f06
Closing. Please ping back if the issue still occurs in the current git version.