MCPcopy Create free account
hub / github.com/Roy3838/Observer / remote_reply

Function remote_reply

api/remote.py:683–710  ·  view source on GitHub ↗

Deprecated: use /remote/send. Send the MCP's final answer to the paired phone over WhatsApp. Charges the WhatsApp quota once, regardless of image count.

(request_data: RemoteReplyRequest, current_user: AuthUser)

Source from the content-addressed store, hash-verified

681
682@remote_router.post("/remote/reply", tags=["Remote"], deprecated=True)
683async def remote_reply(request_data: RemoteReplyRequest, current_user: AuthUser):
684 """Deprecated: use /remote/send. Send the MCP's final answer to the paired phone over
685 WhatsApp. Charges the WhatsApp quota once, regardless of image count."""
686 from messaging import WHATSAPP_WINDOW_CLOSED, assert_content_allowed
687 from quota_manager import try_consume_for
688
689 await _deprecated("/remote/reply", current_user.id)
690 code = await _require_owner(request_data.code, current_user.id)
691 # An old build's reply is its turn's end.
692 await _set_busy(code, "whatsapp", False)
693 address = await bound_address(code, "whatsapp")
694 if not address:
695 raise HTTPException(status_code=404, detail="No WhatsApp linked to this code.")
696
697 if not await whatsapp_window_open(address):
698 raise HTTPException(status_code=403, detail=WHATSAPP_WINDOW_CLOSED)
699
700 assert_content_allowed(request_data.text)
701
702 allowed, _usage_count, _reason = await try_consume_for(current_user, "whatsapp")
703 if not allowed:
704 raise HTTPException(
705 status_code=429,
706 detail={"message": "Daily whatsapp quota has been exceeded.", "quota_type": "whatsapp"},
707 )
708
709 await _deliver("whatsapp", address, request_data.text, (request_data.images or [])[:MAX_REPLY_IMAGES])
710 return {"success": True}
711
712
713@remote_router.post("/remote/telegram/reply", tags=["Remote"], deprecated=True)

Callers

nothing calls this directly

Calls 8

assert_content_allowedFunction · 0.90
try_consume_forFunction · 0.90
_deprecatedFunction · 0.85
_require_ownerFunction · 0.85
_set_busyFunction · 0.85
bound_addressFunction · 0.85
whatsapp_window_openFunction · 0.85
_deliverFunction · 0.85

Tested by

no test coverage detected