fix: 修复如[CQ:face,id=*,raw=[object Object]]的问题。 (#1932)
This commit is contained in:
1 parent
5c18a62530
commit
68e6a9bff9
1 file changed
+6
-1
@@ -73,7 +73,12 @@ export function encodeCQCode (data: OB11MessageData) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
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) {
|
if (text) {
|
||||||
result += `,${name}=${CQCodeEscape(text)}`;
|
result += `,${name}=${CQCodeEscape(text)}`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user