AstraOS commited on
Commit
8eeb72f
·
verified ·
1 Parent(s): 11c0500

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -471,14 +471,14 @@ import requests, os, io
471
 
472
  app = FastAPI()
473
 
474
- BOT_TOKEN = os.getenv("BOT_TOKEN")
475
- BOT_USERNAME = os.getenv("BOT_USERNAME", "python3463_bot")
476
  FALLBACK_IMG = "https://telegram.org/img/t_logo.png"
477
 
478
- if not BOT_TOKEN:
479
- raise RuntimeError("BOT_TOKEN environment variable not set")
480
 
481
- TELEGRAM_API = f"https://api.telegram.org/bot{BOT_TOKEN}"
482
 
483
 
484
  def get_description() -> str:
@@ -521,7 +521,7 @@ def fetch_avatar_bytes() -> bytes | None:
521
  ).json()
522
 
523
  file_path = file_obj["result"]["file_path"]
524
- file_url = f"https://api.telegram.org/file/bot{BOT_TOKEN}/{file_path}"
525
  response = requests.get(file_url, timeout=10)
526
  return response.content if response.status_code == 200 else None
527
 
 
471
 
472
  app = FastAPI()
473
 
474
+ # TOKEN = os.getenv("BOT_TOKEN")
475
+ BOT_USERNAME = os.getenv("BOT_USERNAME", "live_logger_bot")
476
  FALLBACK_IMG = "https://telegram.org/img/t_logo.png"
477
 
478
+ if not TOKEN:
479
+ raise RuntimeError("TOKEN environment variable not set")
480
 
481
+ TELEGRAM_API = f"https://api.telegram.org/bot{TOKEN}"
482
 
483
 
484
  def get_description() -> str:
 
521
  ).json()
522
 
523
  file_path = file_obj["result"]["file_path"]
524
+ file_url = f"https://api.telegram.org/file/bot{TOKEN}/{file_path}"
525
  response = requests.get(file_url, timeout=10)
526
  return response.content if response.status_code == 200 else None
527