mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-16 18:16:39 +00:00
Clear out user if not authorized
This commit is contained in:
parent
cc65ee473e
commit
201497b638
@ -125,7 +125,10 @@ async def connect(self: Client) -> None:
|
|||||||
if self._message_box.is_empty() and self._config.session.user:
|
if self._message_box.is_empty() and self._config.session.user:
|
||||||
try:
|
try:
|
||||||
await self(functions.updates.get_state())
|
await self(functions.updates.get_state())
|
||||||
except Exception:
|
except RpcError as e:
|
||||||
|
if e.code == 401:
|
||||||
|
self._config.session.user = None
|
||||||
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user