mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-23 03:15:58 +00:00
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:
parent
a2379a08ac
commit
124c611426
@ -87,7 +87,7 @@ class WhatsAppChannel(BaseChannel):
|
|||||||
"to": msg.chat_id,
|
"to": msg.chat_id,
|
||||||
"text": msg.content
|
"text": msg.content
|
||||||
}
|
}
|
||||||
await self._ws.send(json.dumps(payload))
|
await self._ws.send(json.dumps(payload, ensure_ascii=False))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error sending WhatsApp message: {e}")
|
logger.error(f"Error sending WhatsApp message: {e}")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user