From d66df3effdd0e044bdc36241391354782c953577 Mon Sep 17 00:00:00 2001 From: Il Harper Date: Thu, 25 Jul 2024 22:41:05 +0800 Subject: [PATCH] fix(shell): satori: api: `message.create` select direct `forward` --- packages/shell/src/satori/routes/message/create.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/shell/src/satori/routes/message/create.ts b/packages/shell/src/satori/routes/message/create.ts index 7d60660..da93c33 100644 --- a/packages/shell/src/satori/routes/message/create.ts +++ b/packages/shell/src/satori/routes/message/create.ts @@ -68,13 +68,15 @@ async function messageCreateUsingJson({ | 'chronocat.internal.message.create2.markdown' = 'chronocat.internal.message.create2.normal' - const forwards = cctx.chronocat.h - .select(payloadRich.content, 'message') - .filter((x) => x.attrs['forward']) + const forwards = + // cctx.chronocat.h.select(payloadRich.content, 'message') + payloadRich.content + .filter((x) => x.type === 'message') // 直接子代而非所有子代 + .filter((x) => x.attrs['forward']) if (forwards.length) { if (forwards.length > 1) { - const err = `尚未支持单次请求发送多条「逐条转发」消息。来自 ${req.socket.remoteAddress}` + const err = `尚未支持单次请求发送多条转发消息。来自 ${req.socket.remoteAddress}` cctx.chronocat.l.error(err, { code: 501,