Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #mkdir project
- #mkdir wapiti3
- #cd project
- #python -m venv env
- #python -m venv wapiti3
- #pip3 install wapiti3
- #https://my.telegram.org/auth?to=apps
- #Отправить тестовое сообщение
- #https://api.telegram.org/bot1791281450:AAHcMZ4SqzchSKgI4iAyDrVOPJhFdb2vCLA/sendMessage?chat_id=877919876&text=Hello%20World
- #Узнать id чата
- #https://api.telegram.org/bot1791281450:AAHcMZ4SqzchSKgI4iAyDrVOPJhFdb2vCLA/getUpdates
- from telethon import TelegramClient, events
- api_id = 5462054
- api_hash = "03d965945a6d2dbfdeb22b10cb95c473"
- client = TelegramClient('my_account', api_id, api_hash)
- @client.on(events.NewMessage)
- async def my_event_handler(event):
- print(event.peer_id)
- client.start()
- client.run_until_disconnected()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement