fix(onebot): align forward message wrapping with OneBot 11 spec

get_forward_msg now returns full OB11Message objects (self_id, time,
message_id, sender, etc.) instead of node-segment wrappers, and event
emission keeps the resId on incoming forward segments instead of
dropping it via the unknown-element fallback. Extends ForwardNodePayload
with optional context fields so download/upload paths preserve enough
state to synthesize the OB11Message shape NapCat clients expect.
This commit is contained in:
DrSmoothl committed 2026-05-13 16:49:29 +08:00
1 parent 6abde40b9c
commit c9fa119a50
4 files changed
+101 -13

No files matched your search

@@ -139,6 +139,13 @@ async function elementToSegment(
};
}
if (element.type === 'forward') {
return {
type: 'forward',
data: { id: element.resId ?? '' },
};
}
// Unknown / unmapped element type — emit an empty segment to keep the
// outgoing message length consistent with the bridge event.
return { type: element.type, data: {} };