MCPcopy Create free account
hub / github.com/Epic0522/Codex-Remote-Contact / buildOneBotReplyMessage

Function buildOneBotReplyMessage

src/server.js:5518–5545  ·  view source on GitHub ↗
(event, reply, options = {})

Source from the content-addressed store, hash-verified

5516}
5517
5518async 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
5547async function fetchOneBotMessage(messageId, selfId) {
5548 if (!messageId) return null;

Callers 1

sendOneBotGroupMessageFunction · 0.85

Calls 3

resolveQqReplyMediaFunction · 0.85
buildQqImageSegmentFunction · 0.85

Tested by

no test coverage detected