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)
| 681 | |
| 682 | @remote_router.post("/remote/reply", tags=["Remote"], deprecated=True) |
| 683 | async 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) |
nothing calls this directly
no test coverage detected