fmab777 commited on
Commit
b3b4ee2
·
verified ·
1 Parent(s): 045ba8b

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -1
main.py CHANGED
@@ -1127,7 +1127,9 @@ async def lifespan(app: Starlette):
1127
  if not await ptb_app.bot.set_webhook(**args): raise RuntimeError("set_webhook returned False.")
1128
  await asyncio.sleep(1.5); info = await ptb_app.bot.get_webhook_info()
1129
  if not (info and info.url == wh_url): raise RuntimeError(f"WH verify fail! Expected '{wh_url}', Got: {info}")
1130
- logger.info(f"WH set & verified: URL='{info.url}', Secret={'YES' if WEBHOOK_SECRET else 'NO'}"); if info.last_error_message: logger.warning(f"WH status error: {info.last_error_message}")
 
 
1131
  await ptb_app.start(); logger.info("PTB started (webhook).")
1132
  except Exception as e: logger.error(f"FATAL: WH setup error: {e}", exc_info=True); raise RuntimeError(f"WH setup fail: {e}") from e
1133
  elif not deleted_ok: raise RuntimeError("Failed to delete previous webhook.")
 
1127
  if not await ptb_app.bot.set_webhook(**args): raise RuntimeError("set_webhook returned False.")
1128
  await asyncio.sleep(1.5); info = await ptb_app.bot.get_webhook_info()
1129
  if not (info and info.url == wh_url): raise RuntimeError(f"WH verify fail! Expected '{wh_url}', Got: {info}")
1130
+ logger.info(f"WH set & verified: URL='{info.url}', Secret={'YES' if WEBHOOK_SECRET else 'NO'}")
1131
+ if info.last_error_message:
1132
+ logger.warning(f"WH status error: {info.last_error_message}")
1133
  await ptb_app.start(); logger.info("PTB started (webhook).")
1134
  except Exception as e: logger.error(f"FATAL: WH setup error: {e}", exc_info=True); raise RuntimeError(f"WH setup fail: {e}") from e
1135
  elif not deleted_ok: raise RuntimeError("Failed to delete previous webhook.")