Save session on connect and fix some typos

The session is saved upon connecting with the hope to make
sure that the authorization key gets saved to disk before
the next run.
This commit is contained in:
Lonami Exo 2018-10-24 16:39:59 +02:00
parent 4562ba9ccf
commit 2c61c50671
3 changed files with 3 additions and 2 deletions

View File

@ -501,7 +501,7 @@ For instance, let's imagine ``you`` are the bot talking to ``usr``:
<usr> ?
<you> Your name didn't have any letters! Try again
<usr> Lonami
<you> Thanks!
<you> Thanks Lonami!
This can be programmed as follows:

View File

@ -313,6 +313,7 @@ class TelegramBaseClient(abc.ABC):
loop=self._loop, proxy=self._proxy
))
self.session.auth_key = self._sender.auth_key
self.session.save()
await self._sender.send(self._init_with(
functions.help.GetConfigRequest()))

View File

@ -351,7 +351,7 @@ async def handler(event):
for i in range(1, 4)
]
what = max(rates, key=lambda t: t[1])
if what[1] < 0.7:
if what[1] < 0.75:
return
name = what[0]