pypi Telethon 0.13
Connection modes

latest releases: 1.35.0, 1.34.0, 1.33.1...
6 years ago
Scheme layer used: 71

The purpose of this release is to denote a big change, now you can connect to Telegram through different connection modes. Also, a second thread will always be started when you connect a TelegramClient, despite whether you'll be handling updates or ignoring them, whose sole purpose is to constantly read from the network.

The reason for this change is as simple as "reading and writing shouldn't be related". Even when you're simply ignoring updates, this way, once you send a request you will only need to read the result for the request. Whatever Telegram sent before has already been read and outside the buffer.

Additions

  • The mentioned different connection modes, and a new thread.
  • You can modify the Session attributes through the TelegramClient constructor (using **kwargs).
  • RPCError's now belong to some request you've made, which makes more sense.
  • get_input_* now handles None (default) parameters more gracefully (it used to crash).

Enhancements

  • The low-level socket doesn't use a handcrafted timeout anymore, which should benefit by avoiding the arbitrary sleep(0.1) that there used to be.
  • TelegramClient.sign_in will call .send_code_request if no code was provided.

Deprecation:

  • .sign_up does not take a phone argument anymore. Change this or you will be using phone as code, and it will fail! The definition looks like def sign_up(self, code, first_name, last_name='').
  • The old JsonSession finally replaces the original Session (which used pickle). If you were overriding any of these, you should only worry about overriding Session now.

Don't miss a new Telethon release

NewReleases is sending notifications on new releases.