mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
251c1830a5
The code generator now handles okay the flags using True type Also, double checking for the flag is now avoided in cases where the flag was a Vector type
25 lines
911 B
Python
Executable File
25 lines
911 B
Python
Executable File
import tl_generator
|
|
from tl.telegram_client import TelegramClient
|
|
from utils.helpers import load_settings
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if not tl_generator.tlobjects_exist():
|
|
print('Please run `python3 tl_generator.py` first!')
|
|
|
|
else:
|
|
settings = load_settings()
|
|
client = TelegramClient(session_user_id=settings.get('session_name', 'anonymous'),
|
|
layer=54,
|
|
api_id=settings['api_id'],
|
|
api_hash=settings['api_hash'])
|
|
|
|
client.connect()
|
|
if not client.is_user_authorized():
|
|
phone_code_hash = None
|
|
while phone_code_hash is None:
|
|
phone_code_hash = client.send_code_request(settings['user_phone'])
|
|
|
|
code = input('Enter the code you just received: ')
|
|
client.make_auth(settings['user_phone'], phone_code_hash, code)
|