import asyncio from playwright.async_api import async_playwright from application_handler import ApplicationHandler from telegram_bot import TelegramBot async def main(): async with async_playwright() as p: browser = await p.chromium.launch(headless=True) context = await browser.new_context() # Initialize the application app_handler = ApplicationHandler(context) bot = TelegramBot(app_handler) bot.start() # Keep the bot running try: await asyncio.Event().wait() except (KeyboardInterrupt, SystemExit): print("Shutting down...") if __name__ == "__main__": asyncio.run(main())