(event, reply, options = {})
| 5516 | } |
| 5517 | |
| 5518 | async function buildOneBotReplyMessage(event, reply, options = {}) { |
| 5519 | const message = []; |
| 5520 | const sourceMessageId = event.raw?.message_id; |
| 5521 | if (options.quoteSource !== false && sourceMessageId != null) { |
| 5522 | message.push({ |
| 5523 | type: "reply", |
| 5524 | data: { id: String(sourceMessageId) } |
| 5525 | }); |
| 5526 | } |
| 5527 | const imagePaths = await resolveQqReplyMedia(reply, { stickerDir: qqStickerDir }); |
| 5528 | const text = stripQqImageAttachmentMarkers(reply); |
| 5529 | if (text) { |
| 5530 | message.push({ |
| 5531 | type: "text", |
| 5532 | data: { text } |
| 5533 | }); |
| 5534 | } |
| 5535 | for (const imagePath of imagePaths) { |
| 5536 | message.push(buildQqImageSegment(imagePath)); |
| 5537 | } |
| 5538 | if (message.length === 0) { |
| 5539 | message.push({ |
| 5540 | type: "text", |
| 5541 | data: { text: "这个表情包没找到,请先把素材放进表情包库。" } |
| 5542 | }); |
| 5543 | } |
| 5544 | return message; |
| 5545 | } |
| 5546 | |
| 5547 | async function fetchOneBotMessage(messageId, selfId) { |
| 5548 | if (!messageId) return null; |
no test coverage detected