wohnbot/main.py
2025-12-27 11:59:04 +01:00

23 lines
No EOL
685 B
Python

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())