dynstat commited on
Commit
16b1edc
·
verified ·
1 Parent(s): f6ac2cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -65,7 +65,8 @@ async def set_webhook():
65
  # Construct the webhook URL using the SPACE_ID environment variable
66
  webhook_url = f"https://dynstat-test2.hf.space/webhook"
67
  # Telegram API URL to set the webhook
68
- set_webhook_url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/setWebhook"
 
69
  # Payload containing the webhook URL and the secret token for security
70
  payload = {
71
  "url": webhook_url,
@@ -82,7 +83,7 @@ async def set_webhook():
82
  async def test_conn():
83
  try:
84
  async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10)) as session:
85
- async with session.get("https://api.telegram.org") as response:
86
  return {"status": "success", "telegram_api_status": response.status}
87
  except Exception as e:
88
  logger.error(f"Connection test failed: {str(e)}", exc_info=True)
 
65
  # Construct the webhook URL using the SPACE_ID environment variable
66
  webhook_url = f"https://dynstat-test2.hf.space/webhook"
67
  # Telegram API URL to set the webhook
68
+ # set_webhook_url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/setWebhook"
69
+ set_webhook_url = f"https://149.154.167.220/bot{TELEGRAM_BOT_TOKEN}/setWebhook"
70
  # Payload containing the webhook URL and the secret token for security
71
  payload = {
72
  "url": webhook_url,
 
83
  async def test_conn():
84
  try:
85
  async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10)) as session:
86
+ async with session.get("https://149.154.167.220") as response:
87
  return {"status": "success", "telegram_api_status": response.status}
88
  except Exception as e:
89
  logger.error(f"Connection test failed: {str(e)}", exc_info=True)