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 theTelegramClient
constructor (using**kwargs
). RPCError
's now belong to some request you've made, which makes more sense.get_input_*
now handlesNone
(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 nocode
was provided.
Deprecation:
.sign_up
does not take aphone
argument anymore. Change this or you will be usingphone
ascode
, and it will fail! The definition looks likedef sign_up(self, code, first_name, last_name='')
.- The old
JsonSession
finally replaces the originalSession
(which used pickle). If you were overriding any of these, you should only worry about overridingSession
now.