/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
telegram__telethon__examples/hello_world.py
27 строк
718 B
gil9red
Refactoring. Using black code style
27 июн 2023, 15:23
27 июн 2023, 15:23
65db4a1
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" # SOURCE: https://github.com/LonamiWebs/Telethon # SOURCE: https://my.telegram.org/apps # pip install telethon from telethon.sync import TelegramClient, events from config import API_ID, API_HASH with TelegramClient("my", API_ID, API_HASH) as client: client.send_message("me", "Hello, myself!") print("Picture big:", client.download_profile_photo("me")) print("Picture small:", client.download_profile_photo("me", download_big=False)) @client.on(events.NewMessage(pattern="(?i).*Hello")) async def handler(event): print(event.stringify()) await event.reply("Hey!") client.run_until_disconnected()