fix(onebot): resolve voice transcription for signed message IDs

Allow voice transcription results to complete for messages with negative IDs while preserving existing message identities and account isolation.

Report unmatched transcription results accurately and document the signed message ID contract.

Fixes #554
This commit is contained in:
DrSmoothl committed 2026-10-20 13:27:40 +08:00
1 parent 79522d949f
commit 76846f40b1
10 files changed
+153 -18

No files matched your search

+3 -5
View File
@@ -12,10 +12,8 @@ import type { pb, uint_32, uint_64 } from '@snowluma/proton';
* fields (uuid / md5) and the response `text` tag should be confirmed with a
* single live capture before relying on them.
*
* Flow: send Trans{C2C,Group}PttReq → response carries the text inline when
* transcription is already done; when it's empty the server transcribes
* asynchronously (no dedicated push command exists — see NotifyTransUpdate),
* so the caller re-sends with backoff until the text arrives or it times out.
* Flow: the response can carry completed text inline. Otherwise, the caller
* waits for an asynchronous result correlated with the original message ID.
*/
/** Source ptt-element field (NT internal tag) noted in the comment after each. */
@@ -73,7 +71,7 @@ export interface GroupPttTransResult {
/**
* Outer response. `type` echoes the scene; result is at field 2 (group) /
* field 3 (c2c). An empty `text` with `errCode == 0` means "transcribing,
* retry later".
* await the result push".
*/
export interface PttTransResp {
type?: pb<1, uint_32>;