Fix: Add ensure_ascii=False to WhatsApp send payload

The send() payload contains user message content (msg.content) which
may include non-ASCII characters (e.g. CJK, German umlauts, emoji).

The auth frame and Discord heartbeat/identify payloads are left
unchanged as they only carry ASCII protocol fields.
This commit is contained in:
chtangwin
2026-02-18 18:46:23 -08:00
parent a2379a08ac
commit 124c611426

View File

@@ -87,7 +87,7 @@ class WhatsAppChannel(BaseChannel):
"to": msg.chat_id,
"text": msg.content
}
await self._ws.send(json.dumps(payload))
await self._ws.send(json.dumps(payload, ensure_ascii=False))
except Exception as e:
logger.error(f"Error sending WhatsApp message: {e}")