AstraOS commited on
Commit
951c00a
·
verified ·
1 Parent(s): 04a9f8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -20
app.py CHANGED
@@ -459,26 +459,29 @@ app = FastAPI()
459
  @app.get("/")
460
  def root(): # ② health‑check hits this → must return 200 quickly
461
  # return {"status": "ok"}
462
- # return RedirectResponse(url="https://t.me/python3463_bot")
463
- html_content = """
464
- <!DOCTYPE html>
465
- <html>
466
- <head>
467
- <title>Telegram Bot Preview</title>
468
- <meta property="og:title" content="Join the Python Bot" />
469
- <meta property="og:description" content="Click to chat with the Python Bot on Telegram." />
470
- <meta property="og:url" content="https://t.me/python3463_bot" />
471
- <meta property="og:type" content="website" />
472
- <meta property="og:image" content="https://telegram.org/img/t_logo.png" />
473
- </head>
474
- <body>
475
- <h1>Open Telegram Bot</h1>
476
- <p><a href="https://t.me/python3463_bot" target="_blank">Click here to open the bot</a></p>
477
- <iframe src="https://t.me/python3463_bot" width="100%" height="500px" style="border:none;"></iframe>
478
- </body>
479
- </html>
480
- """
481
- return HTMLResponse(content=html_content)
 
 
 
482
 
483
  @app.on_event("startup")
484
  def startup():
 
459
  @app.get("/")
460
  def root(): # ② health‑check hits this → must return 200 quickly
461
  # return {"status": "ok"}
462
+ return RedirectResponse(
463
+ url="https://t.me/python3463_bot",
464
+ status_code=status.HTTP_302_FOUND # 302 is fine too
465
+ )
466
+ # html_content = """
467
+ # <!DOCTYPE html>
468
+ # <html>
469
+ # <head>
470
+ # <title>Telegram Bot Preview</title>
471
+ # <meta property="og:title" content="Join the Python Bot" />
472
+ # <meta property="og:description" content="Click to chat with the Python Bot on Telegram." />
473
+ # <meta property="og:url" content="https://t.me/python3463_bot" />
474
+ # <meta property="og:type" content="website" />
475
+ # <meta property="og:image" content="https://telegram.org/img/t_logo.png" />
476
+ # </head>
477
+ # <body>
478
+ # <h1>Open Telegram Bot</h1>
479
+ # <p><a href="https://t.me/python3463_bot" target="_blank">Click here to open the bot</a></p>
480
+ # <iframe src="https://t.me/python3463_bot" width="100%" height="500px" style="border:none;"></iframe>
481
+ # </body>
482
+ # </html>
483
+ # """
484
+ # return HTMLResponse(content=html_content)
485
 
486
  @app.on_event("startup")
487
  def startup():