major refactor (untested)
This commit is contained in:
parent
a29412b4da
commit
a77a0c0393
22 changed files with 1037 additions and 24 deletions
23
main.py
Normal file
23
main.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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())
|
||||
Loading…
Add table
Add a link
Reference in a new issue