Telethon Updates
1.44K subscribers
29 photos
21 files
1.34K links
Official channel for updates about Telethon.
Official English group: @TelethonChat

Other channels:
• Russian: @TelethonRussian
• Persian: @TelethonGap
• Snippets: @TelethonSnippets2
Download Telegram
Add set_proxy to the method summary (e3a194a by Lonami)
Fix crypto imports on macOS Big Sur (#1639) (23fc38f by alialaee)
Include service messages for new pins in ChatAction again (2439404 by Lonami)
Add admin log event.has_left (#1642) (1238020 by x0x8x)
Add new known errors to the error list (0b0a1dc by Lonami)
Favour text parameter when editing inline messages (#1643) (44aca29 by penn5)
Unconditionally disconnect exported senders on user disconnect (1cd1139 by Lonami)
Update to layer 122 (0a4d54f by Lonami)
Start reconnect if a second ping is sent without a pong for the first (becfe2c by Lonami)
Fix AttributeError on reconnect with no retries (ee0fc5c by Lonami)
When using client.download_media to download media into a local path (str or Path), do you use the partial contents of the file as it gets downloaded in some way? That is, do you read or stat the same path while the download is ongoing?

If the power goes down in the middle of the operation, the file will be in a inconsistent state, and the library won't know this unless your code has some protections against it, as pointed out by https://github.com/LonamiWebs/Telethon/issues/1647.

One solution is to download the path to a temporary directory and iff the entire download succeeds, move it to the location you asked for. However this means you won't know where the file is and thus can't stat or read from it.

Regardless, to check the progress, progress_callback is the only way to do this, and is directly supported by the library, which should be preferred over using stat on the file.
Do you read from or stat the file download_media creates while it's downloading?
Anonymous Poll
40%
Yes
60%
No
Telethon Updates pinned «When using client.download_media to download media into a local path (str or Path), do you use the partial contents of the file as it gets downloaded in some way? That is, do you read or stat the same path while the download is ongoing? If the power goes…»
Those who vote yes, please indicate your use case in the official group, as I'd love to hear it
Update to layer 122 (again) (#1650) (5011747 by AndrewLaneX)
Ignore PhotoPathSize thumbnail sizes (dd00829 by Lonami)
Update docs and list of errors (4b6c69a by Lonami)
Update layer and known errors again (acd4c86 by Lonami)
Voice Calls and Telethon

A few people have asked now whether Telethon will support the new Telegram calls. The answer is: Telethon will contain the raw API methods needed to initiate and manage calls (and in fact, already does in the version available in the GitHub repository). You can play around with them by installing Telethon from GitHub, and you can also build the offline TL reference for the new layer if you prefer looking at the new methods this way (and not using an IDE or Python's help(…)).

Telethon will likely not offer ways to stream audio directly. Telethon's focus is being an asyncio-based, pure-Python implementation to interact with Telegram's API. Streaming audio is beyond the current scope of the project and would be a big undertaking.

However, that doesn't mean calls are not possible with Telethon. If you want to help design a Python library to perform audio calls, which can then be used with Telethon (so you can use Telethon + that new library to perform calls with Telethon), please refer to @pytgcallschat and join the relevant chat to discuss and help with the implementation!

I simply don't have the time or interest to dedicate myself to work on calls too, which is why it should be an outside effort first.
Telethon Updates pinned «Voice Calls and Telethon A few people have asked now whether Telethon will support the new Telegram calls. The answer is: Telethon will contain the raw API methods needed to initiate and manage calls (and in fact, already does in the version available in…»