Spaces:
Runtime error
Runtime error
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -203,6 +203,15 @@ def main() -> None:
|
|
| 203 |
webhook_requests_handler = SimpleRequestHandler(dispatcher=dp, bot=bot)
|
| 204 |
webhook_requests_handler.register(app, path=config.WEBHOOK_PATH)
|
| 205 |
setup_application(app, dp, bot=bot)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
app.on_startup.append(on_startup)
|
| 208 |
app.on_shutdown.append(on_shutdown)
|
|
|
|
| 203 |
webhook_requests_handler = SimpleRequestHandler(dispatcher=dp, bot=bot)
|
| 204 |
webhook_requests_handler.register(app, path=config.WEBHOOK_PATH)
|
| 205 |
setup_application(app, dp, bot=bot)
|
| 206 |
+
|
| 207 |
+
# Дополнительный raw endpoint для проверки
|
| 208 |
+
async def debug_webhook(request: web.Request) -> web.Response:
|
| 209 |
+
body = await request.text()
|
| 210 |
+
logger.info("RAW WEBHOOK BODY: %s", body[:500])
|
| 211 |
+
return web.Response(text="OK")
|
| 212 |
+
|
| 213 |
+
app.router.add_post("/webhook-debug", debug_webhook)
|
| 214 |
+
|
| 215 |
|
| 216 |
app.on_startup.append(on_startup)
|
| 217 |
app.on_shutdown.append(on_shutdown)
|