This commit is contained in:
Timothy Jaeryang Baek
2026-06-15 12:04:10 +02:00
Unverified
parent acd4285dc9
commit 33cc710d10
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -281,9 +281,12 @@ async def whatsapp_webhook_verify(bot_id: str, request: Request):
@webhook_router.post("/whatsapp/{bot_id}")
async def whatsapp_webhook_inbound(bot_id: str, request: Request):
"""Receive inbound WhatsApp messages via webhook."""
from cptr.utils.bridge import bot_manager
payload = await request.json()
bot_manager = getattr(request.app.state, "bot_manager", None)
if not bot_manager:
raise HTTPException(503, "Bot manager not initialized")
adapter = bot_manager._adapters.get(bot_id)
if adapter:
from cptr.utils.adapters.whatsapp import WhatsAppAdapter
+1 -1
View File
@@ -524,7 +524,7 @@ class BotManager:
return
# Update bot config with new workspace
from cptr.utils.config import Config
from cptr.models import Config
bots_raw = await Config.get("bots") or []
for b in bots_raw:
if b.get("id") == bot["id"]: