From 68e6a9bff9efc59b652252157b2502aafe1291b3 Mon Sep 17 00:00:00 2001 From: Bluemangoo Date: Wed, 24 Jun 2026 15:38:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A6=82`[CQ:face,id?= =?UTF-8?q?=3D*,raw=3D[object=20Object]]`=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=20(#1932)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/napcat-onebot/helper/cqcode.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/napcat-onebot/helper/cqcode.ts b/packages/napcat-onebot/helper/cqcode.ts index 9c59de1b8..a0ee3ebbc 100644 --- a/packages/napcat-onebot/helper/cqcode.ts +++ b/packages/napcat-onebot/helper/cqcode.ts @@ -73,7 +73,12 @@ export function encodeCQCode (data: OB11MessageData) { continue; } try { - const text = value?.toString(); + let text: string | undefined; + if (typeof value === 'object' && value?.toString === Object.prototype.toString) { + text = JSON.stringify(value); + } else { + text = value?.toString(); + } if (text) { result += `,${name}=${CQCodeEscape(text)}`; }