mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
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:
parent
4562ba9ccf
commit
2c61c50671
|
@ -501,7 +501,7 @@ For instance, let's imagine ``you`` are the bot talking to ``usr``:
|
||||||
<usr> ?
|
<usr> ?
|
||||||
<you> Your name didn't have any letters! Try again
|
<you> Your name didn't have any letters! Try again
|
||||||
<usr> Lonami
|
<usr> Lonami
|
||||||
<you> Thanks!
|
<you> Thanks Lonami!
|
||||||
|
|
||||||
This can be programmed as follows:
|
This can be programmed as follows:
|
||||||
|
|
||||||
|
|
|
@ -313,6 +313,7 @@ class TelegramBaseClient(abc.ABC):
|
||||||
loop=self._loop, proxy=self._proxy
|
loop=self._loop, proxy=self._proxy
|
||||||
))
|
))
|
||||||
self.session.auth_key = self._sender.auth_key
|
self.session.auth_key = self._sender.auth_key
|
||||||
|
self.session.save()
|
||||||
|
|
||||||
await self._sender.send(self._init_with(
|
await self._sender.send(self._init_with(
|
||||||
functions.help.GetConfigRequest()))
|
functions.help.GetConfigRequest()))
|
||||||
|
|
|
@ -351,7 +351,7 @@ async def handler(event):
|
||||||
for i in range(1, 4)
|
for i in range(1, 4)
|
||||||
]
|
]
|
||||||
what = max(rates, key=lambda t: t[1])
|
what = max(rates, key=lambda t: t[1])
|
||||||
if what[1] < 0.7:
|
if what[1] < 0.75:
|
||||||
return
|
return
|
||||||
|
|
||||||
name = what[0]
|
name = what[0]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user