app state fix
All checks were successful
Build Docs / changes (push) Successful in 4s
Build Docs / build-docs (push) Has been skipped
Build Docs / deploy-docs (push) Has been skipped

This commit is contained in:
Alexander Kalinovsky
2025-03-19 15:09:12 +07:00
parent fe0380f9f3
commit 5e2b8e51f6

View File

@@ -30,12 +30,14 @@ async def telegram_webhook(
logger.error("Invalid request", exc_info=True) logger.error("Invalid request", exc_info=True)
return Response(status_code=400) return Response(status_code=400)
try: try:
state_kw = request.state._state #TODO: avoid accessing private attribute
await app.dp.feed_webhook_update( await app.dp.feed_webhook_update(
app.bot, app.bot,
update, update,
db_session=db_session, db_session=db_session,
app=app, app=app,
**(request.state if request.state else {}), **(state_kw or {}),
) )
except Exception: except Exception:
logger.error("Error processing update", exc_info=True) logger.error("Error processing update", exc_info=True)