rag2 / tg_app /try_telethon.py
AlexanderKazakov
try telethon
9ca6868
raw
history blame
339 Bytes
from telethon import TelegramClient
with open('data/tg_api_id.txt') as f:
api_id = f.read().strip()
with open('data/tg_app_api_hash.txt') as f:
api_hash = f.read().strip()
with TelegramClient('data/session.session', api_id, api_hash) as client:
client.loop.run_until_complete(client.send_message('me', 'Hello, myself!'))