feat(messages): support animated face results

Allow selecting animated face results and preserve received results in messages and history. Keep the default selection when no result is supplied.

Fixes #487
This commit is contained in:
DrSmoothl committed 2026-09-27 13:44:48 +08:00
1 parent 8cc5326a3a
commit 93b5c1b4bf
13 files changed
+185 -15

No files matched your search

+1 -2
View File
@@ -10,7 +10,7 @@ export function segmentToCQ(seg: JsonObject): string {
case 'text':
return cqEscape(String(data.text ?? ''));
case 'face':
return `[CQ:face,id=${data.id ?? 0}]`;
return `[CQ:face,id=${data.id ?? 0}${data.resultId !== undefined ? `,resultId=${cqEscape(String(data.resultId))}` : ''}]`;
case 'image':
return `[CQ:image,file=${cqEscape(String(data.file ?? ''))},url=${cqEscape(String(data.url ?? ''))}]`;
case 'at':
@@ -77,4 +77,3 @@ export async function parseFromCQString(message: string, options?: ParseMessageO
return elements;
}