Advertisement
load-net

Узнать id TG

Mar 25th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #mkdir project
  2. #mkdir wapiti3
  3. #cd project
  4. #python -m venv env
  5.  
  6. #python -m venv wapiti3
  7. #pip3 install wapiti3
  8.  
  9. #https://my.telegram.org/auth?to=apps
  10.  
  11. #Отправить тестовое сообщение
  12. #https://api.telegram.org/bot1791281450:AAHcMZ4SqzchSKgI4iAyDrVOPJhFdb2vCLA/sendMessage?chat_id=877919876&text=Hello%20World
  13.  
  14. #Узнать id чата
  15. #https://api.telegram.org/bot1791281450:AAHcMZ4SqzchSKgI4iAyDrVOPJhFdb2vCLA/getUpdates
  16.  
  17.  
  18. from telethon import TelegramClient, events
  19. api_id = 5462054
  20. api_hash = "03d965945a6d2dbfdeb22b10cb95c473"
  21. client = TelegramClient('my_account', api_id, api_hash)
  22. @client.on(events.NewMessage)
  23. async def my_event_handler(event):
  24. print(event.peer_id)
  25. client.start()
  26. client.run_until_disconnected()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement