File size: 339 Bytes
9ca6868 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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!'))
|