fix: 修复如[CQ:face,id=*,raw=[object Object]]的问题。 (#1932)

This commit is contained in:
Bluemangoo authored and GitHub committed 2026-06-24 15:38:47 +08:00
1 parent 5c18a62530
commit 68e6a9bff9
1 file changed
+6 -1
+6 -1
View File
@@ -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)}`;
}