Spaces:
Sleeping
Sleeping
Download telegram_controller.py from evgeniy778/Apckeyl_RealESRGAN: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/spaces/evgeniy778/Apckeyl_RealESRGAN/resolve/main/telegram_controller.py
- Command line
-
hf download hf://spaces/evgeniy778/Apckeyl_RealESRGAN/telegram_controller.py
-
curl -L -o telegram_controller.py https://huggingface.co/spaces/evgeniy778/Apckeyl_RealESRGAN/resolve/main/telegram_controller.py
1.9 kB
| # ===================================================== | |
| # Apckeyl Framework | |
| # Version 1.1 | |
| # telegram_controller.py | |
| # ===================================================== | |
| """ | |
| Telegram Controller. | |
| Главный диспетчер Telegram Framework. | |
| Version 1.1 | |
| """ | |
| from aiogram import Bot | |
| from aiogram import Dispatcher | |
| class TelegramController: | |
| """ | |
| Центральный контроллер Telegram Framework. | |
| Отвечает только за запуск | |
| и управление жизненным циклом | |
| Telegram Framework. | |
| AI здесь отсутствует. | |
| """ | |
| def __init__( | |
| self, | |
| bot: Bot, | |
| dispatcher: Dispatcher, | |
| ): | |
| self.bot = bot | |
| self.dispatcher = dispatcher | |
| self.handlers_connected = False | |
| # ------------------------------------------------- | |
| def register_handlers(self): | |
| """ | |
| Временная регистрация обработчиков. | |
| Настоящие обработчики будут | |
| подключены после создания | |
| telegram_handlers.py | |
| """ | |
| self.handlers_connected = True | |
| print() | |
| print("Handlers registered.") | |
| # ------------------------------------------------- | |
| async def start(self): | |
| print() | |
| print("====================================") | |
| print("Telegram Controller") | |
| print("Version 1.1") | |
| print("====================================") | |
| print() | |
| self.register_handlers() | |
| print() | |
| print("Controller initialized.") | |
| print( | |
| f"Handlers connected : {self.handlers_connected}" | |
| ) | |
| print() | |
| print( | |
| "Telegram Framework is ready." | |
| ) | |
| print() | |
| print( | |
| "Waiting for telegram_handlers.py..." | |
| ) |