MCPcopy
hub / github.com/AstrBotDevs/AstrBot / send_chat_thread_message

Function send_chat_thread_message

astrbot/dashboard/api/chat.py:264–283  ·  view source on GitHub ↗
(
    thread_id: str,
    request: Request,
    payload: ChatThreadMessageRequest,
    auth: AuthContext = Depends(require_chat_scope),
    service: ChatService = Depends(get_service),
)

Source from the content-addressed store, hash-verified

262
263@router.post("/chat/threads/{thread_id}/messages")
264async def send_chat_thread_message(
265 thread_id: str,
266 request: Request,
267 payload: ChatThreadMessageRequest,
268 auth: AuthContext = Depends(require_chat_scope),
269 service: ChatService = Depends(get_service),
270):
271 try:
272 chat_payload = await service.prepare_thread_chat_payload(
273 auth.username,
274 {"thread_id": thread_id, **_model_dict(payload)},
275 )
276 except ChatServiceError as exc:
277 return JSONResponse(error(str(exc)))
278 return await _send_chat(
279 request=request,
280 username=auth.username,
281 service=service,
282 payload=chat_payload,
283 )
284
285
286@legacy_router.post("/send")

Callers

nothing calls this directly

Calls 4

errorFunction · 0.90
_send_chatFunction · 0.85
_model_dictFunction · 0.70

Tested by

no test coverage detected