import asyncio import logging from modules.thread import Worker logger = logging.getLogger(__name__) async def main(): async with Worker() as worker: await worker.check_all() if __name__ == "__main__": logging.basicConfig( level=logging.INFO, format="%(asctime)s | %(levelname)-7s | %(message)s", datefmt="%H:%M:%S", handlers=[logging.StreamHandler()], ) logging.getLogger("telethon").setLevel(logging.WARNING) logging.getLogger("opentele2").setLevel(logging.WARNING) try: asyncio.run(main()) except KeyboardInterrupt: logger.info("Прервано пользователем") except Exception as e: logger.exception(f"Критическая ошибка: {e}") raise