




















@@ -4,6 +4,7 @@ import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-pay
44import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
55import type { FlexContainer } from "./flex-templates.js";
66import type { ProcessedLineMessage } from "./markdown-to-line.js";
7+import { buildLineQuickReplyFallbackText } from "./quick-reply-fallback.js";
78import type { SendLineReplyChunksParams } from "./reply-chunks.js";
89import type { LineChannelData, LineTemplateMessagePayload } from "./types.js";
910@@ -165,16 +166,34 @@ export async function deliverLineAutoReply(params: {
165166}
166167} else {
167168const combined = [...richMessages, ...mediaMessages];
168-if (hasQuickReplies && combined.length > 0) {
169-const quickReply = deps.createQuickReplyItems(lineData.quickReplies!);
170-const targetIndex =
171-replyToken && !replyTokenUsed ? Math.min(4, combined.length - 1) : combined.length - 1;
172-const target = combined[targetIndex] as messagingApi.Message & {
173-quickReply?: messagingApi.QuickReply;
174-};
175-combined[targetIndex] = { ...target, quickReply };
169+if (hasQuickReplies && combined.length === 0) {
170+const { replyTokenUsed: nextReplyTokenUsed } = await deps.sendLineReplyChunks({
171+ to,
172+chunks: [buildLineQuickReplyFallbackText(lineData.quickReplies)],
173+quickReplies: lineData.quickReplies,
174+ replyToken,
175+ replyTokenUsed,
176+cfg: params.cfg,
177+ accountId,
178+replyMessageLine: deps.replyMessageLine,
179+pushMessageLine: deps.pushMessageLine,
180+pushTextMessageWithQuickReplies: deps.pushTextMessageWithQuickReplies,
181+createTextMessageWithQuickReplies: deps.createTextMessageWithQuickReplies,
182+onReplyError: deps.onReplyError,
183+});
184+replyTokenUsed = nextReplyTokenUsed;
185+} else {
186+if (hasQuickReplies && combined.length > 0) {
187+const quickReply = deps.createQuickReplyItems(lineData.quickReplies!);
188+const targetIndex =
189+replyToken && !replyTokenUsed ? Math.min(4, combined.length - 1) : combined.length - 1;
190+const target = combined[targetIndex] as messagingApi.Message & {
191+quickReply?: messagingApi.QuickReply;
192+};
193+combined[targetIndex] = { ...target, quickReply };
194+}
195+await sendLineMessages(combined, true);
176196}
177-await sendLineMessages(combined, true);
178197}
179198180199return { replyTokenUsed };
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。