(event)
| 5642 | } |
| 5643 | |
| 5644 | async function attachReplyContext(event) { |
| 5645 | if (!event.replyMessageId) return event; |
| 5646 | try { |
| 5647 | const replyContext = await fetchOneBotMessage(event.replyMessageId, event.selfId); |
| 5648 | return { |
| 5649 | ...event, |
| 5650 | replyContext, |
| 5651 | isReplyToSelf: Boolean(replyContext?.isSelf) |
| 5652 | }; |
| 5653 | } catch (error) { |
| 5654 | return { |
| 5655 | ...event, |
| 5656 | replyContextError: error.message, |
| 5657 | isReplyToSelf: false |
| 5658 | }; |
| 5659 | } |
| 5660 | } |
| 5661 | |
| 5662 | function normalizeOneBotEvent(payload) { |
| 5663 | const segments = Array.isArray(payload.message) ? payload.message : []; |
no test coverage detected