from fastapi import APIRouter from core.bot import ROOMS, message_store router = APIRouter(prefix="/api") @router.get("/rooms") async def list_rooms(): return {"rooms": ROOMS} @router.get("/messages/{room_id}") async def get_messages(room_id: str, limit: int = 50): msgs = message_store.get(room_id, []) return {"room_id": room_id, "messages": msgs[-limit:]}