|
|
@@ -65,9 +65,9 @@ async def get_thread(service_key: str, chat_id: str):
|
|
|
|
|
|
@router.post('/chat/{service_key}/{chat_id}', status_code=204)
|
|
|
async def send_message(service_key: str, chat_id: str, payload: _SendBody):
|
|
|
- if service_key == 'booking':
|
|
|
- raise HTTPException(501, 'Booking.com send_message is temporarily disabled pending API debugging')
|
|
|
client = _get_chat_client(service_key)
|
|
|
+ if not client.send_ready():
|
|
|
+ raise HTTPException(503, f'{service_key!r} chat sending is not available')
|
|
|
try:
|
|
|
await client.send_message(chat_id, payload.body)
|
|
|
except ServiceAuthError as e:
|