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:
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: {} };
|
||||
|
||||
Reference in new issue
Block a user