mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Fix is_user_authorized failing on log_out (closes #76)
This commit is contained in:
parent
f64244eb44
commit
d0284c2bd3
|
@ -188,7 +188,9 @@ class TelegramClient:
|
||||||
def is_user_authorized(self):
|
def is_user_authorized(self):
|
||||||
"""Has the user been authorized yet (code request sent and confirmed)?
|
"""Has the user been authorized yet (code request sent and confirmed)?
|
||||||
Note that this will NOT yield the correct result if the session was revoked by another client!"""
|
Note that this will NOT yield the correct result if the session was revoked by another client!"""
|
||||||
return self.session.user is not None
|
if self.session and self.session.user is not None:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def send_code_request(self, phone_number):
|
def send_code_request(self, phone_number):
|
||||||
"""Sends a code request to the specified phone number"""
|
"""Sends a code request to the specified phone number"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user