Telethon

Latest version: v1.35.0

Safety actively analyzes 629639 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

0.11.2

<table><tr><td>Scheme layer used: <code>68</code> (<a href="https://github.com/LonamiWebs/Telethon/commit/23e280221548d8170ef6fd08af9d8816ceae0c6a#diff-4f5ddcbaea8262901baacf4569653ba4">changes</a>)</td></tr></table>

There is a new preferred way to **invoke requests**, which you're encouraged to use:
python
New!
result = client(SomeRequest())

Old.
result = client.invoke(SomeRequest())


Existing code will continue working, since the old `.invoke()` has not been deprecated.

When you `.create_new_connection()`, it will also handle `FileMigrateError`'s for you, so you don't need to worry about those anymore.

Bugs fixed:
* Fixed some errors when installing Telethon via `pip` (for those using either source distributions or a Python version ≤ 3.5).
* `ConnectionResetError` didn't flag sockets as closed, but now it does.

On a more technical side, `msg_id`'s are now more accurate.

0.11.1

<table><tr><td>Scheme layer used: <code>66</code></td></tr></table>

Receiving new updates shouldn't miss any anymore, also, periodic pings are back again so it should work on the long run.

On a different order of things, `.connect()` also features a timeout. Notice that the `timeout=` is **not** passed as a **parameter** anymore, and is instead specified when creating the `TelegramClient`.


Some other bug fixes:
* Fixed some name class when a request had a `.msg_id` parameter.
* The correct amount of random bytes is now used in DH request
* Fixed `CONNECTION_APP_VERSION_EMPTY` when using temporary sessions.
* Avoid connecting if already connected.

0.11

<table><tr><td>Scheme layer used: <code>66</code></td></tr></table>

_This update brings a lot of changes, so it would be nice if you could **read the whole change log**!_


Things that may break your code
* Every Telegram error has now its **own class**, so it's easier to fine-tune your `except`'s.
* Markdown parsing is **not part** of Telethon itself anymore, although there are plans to support it again through a some external module.
* The `.list_sessions()` has been moved to the `Session` class instead.
* The `InteractiveTelegramClient` is **not** shipped with `pip` anymore.

New features
* A new, more **lightweight class** has been added. The `TelegramBareClient` is now the base of the normal `TelegramClient`, and has the most basic features.
* New method to `.create_new_connection()`, which can be ran **in parallel** with the original connection. This will return the previously mentioned `TelegramBareClient` already connected.
* Any file object can now be used to download a file (for instance, a `BytesIO()` instead a file name).
* Vales like `random_id` are now **automatically inferred**, so you can save yourself from the hassle of writing `generate_random_long()` everywhere. Same applies to `.get_input_peer()`, unless you really need the extra performance provided by skipping one `if` if called manually.
* Every type now features a new `.to_dict()` method.

Bug fixes
* Received errors are acknowledged to the server, so they don't happen over and over.
* Downloading media on different data centers is now up to **x2 faster**, since there used to be an `InvalidDCError` for each file part tried to be downloaded.
* Lost messages are now properly skipped.
* New way to handle the **result of requests**. The old `ValueError` "*The previously sent request must be resent. However, no request was previously sent (possibly called from a different thread).*" *should* not happen anymore.

Minor highlights
* Some fixes to the `JsonSession`.
* Fixed possibly crashes if trying to `.invoke()` a `Request` while `.reconnect()` was being called on the `UpdatesThread`.
* Some improvements on the `TcpClient`, such as not switching between blocking and non-blocking sockets.
* The code now uses ASCII characters only.
* Some enhancements to `.find_user_or_chat()` and `.get_input_peer()`.

0.10.1

<table><tr><td>Scheme layer used: <code>66</code></td></tr></table>

This version is primarily for people to **migrate** their `.session` files, which are *pickled*, to the new *JSON* format. Although slightly slower, and a bit more vulnerable since it's plain text, it's a lot more resistant to upgrades.

Please **upgrade to this version** before any higher one if you've used Telethon ≤ v0.10. If you happen to upgrade to an higher version, that's okay, but you will have to manually delete the `*.session` file, and logout from that session from an official client.

Other highlights:
* New `.get_me()` function to get the **current** user.
* `.is_user_authorized()` is now more reliable.
* New nice button to copy the `from telethon.tl.xxx.yyy import Yyy` on the online documentation.
* Everything on the documentation is now, theoretically, **sorted alphabetically**.
* **More error codes** added to the `errors` file.
* No second thread is spawned unless one or more update handlers are added.

0.10

<table><tr><td>Scheme layer used: <code>66</code></td></tr></table>

Working with **different data centers** finally *works*! On a different order of things, **reconnection** is now performed automatically every time Telegram decides to kick us off their servers, so now Telethon can really run **forever and ever**! In theory.

Another important highlights:

* **Documentation** improvements, such as showing the return type.
* The `msg_id too low/high` error should happen **less often**, if any.
* Sleeping on the main thread is **not done anymore**. You will have to `except FloodWaitError`'s.
* You can now specify your *own application version*, device model, system version and language code.
* Code is now more *pythonic* (such as making some members private), and other internal improvements (which affect the **updates thread**), such as using `logger` instead a bare `print()` too.

This brings Telethon a whole step closer to `v1.0`, though more things should preferably be changed.

0.9.1

<table><tr><td>Scheme layer used: <code>66</code> (<a href="https://github.com/LonamiWebs/Telethon/commit/befc7a5657597ac41f4bd4465a53d0c206456ea5#diff-4f5ddcbaea8262901baacf4569653ba4">changes</a>)</td></tr></table>

Telethon used to crash a lot when logging in for the very first time. The reason for this was that the reconnection (or dead connections) were not handled properly. Now they are, so you should be able to login directly, without needing to delete the `*.session` file anymore. Notice that downloading from a different DC is still a WIP.

Some highlights:
* Updates thread is only started after a successful login.
* Files meant to be ran by the user now use **shebangs** and proper permissions.
* In-code documentation now shows the returning type.
* **Relative import** is now used everywhere, so you can rename `telethon` to anything else.
* **Dead connections** are now **detected** instead entering an infinite loop.
* **Sockets** can now be **closed** (and re-opened) properly.
* Telegram decided to update the layer 66 without increasing the number. This has been fixed and now we're up-to-date again.

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.