Commit Graph
1 Commits
Author SHA1 Message Date
GZY-SUPER-HACKER 634d0e9188 feat(qq): show the agent the message a user quoted
QQ's C2C/group events never carry `message_reference`; botpy models that field
because the object is shared with guild messages, but QQ never sends it here.
The quoted original arrives in `msg_elements`, linked from
`message_scene.ext` by `ref_msg_idx`, and neither field is parsed by botpy —
`BaseMessage.__slots__` also drops the raw payload, so the content is lost
before the channel can see it.

Capture the raw payload from the message constructor, resolve the quoted text
by matching `ref_msg_idx` against the element's `msg_idx`, and surface it as a
`[Reply to: ...]` prefix on the inbound content, mirroring the inbound reply
context Telegram already provides.

The capture is idempotent and degrades silently if the botpy shape differs;
`_quoted_content_for` prefers fields on the message object when a future botpy
exposes them, so the hook becomes dead weight rather than a correctness
dependency.
2026-10-09 13:32:32 +08:00