mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 16:41:49 +00:00
refactor: deduplicate reply payload handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
||||
import type { ResolvedZaloAccount } from "./accounts.js";
|
||||
import {
|
||||
ZaloApiError,
|
||||
@@ -579,11 +580,13 @@ async function deliverZaloReply(params: {
|
||||
}): Promise<void> {
|
||||
const { payload, token, chatId, runtime, core, config, accountId, statusSink, fetcher } = params;
|
||||
const tableMode = params.tableMode ?? "code";
|
||||
const text = core.channel.text.convertMarkdownTables(payload.text ?? "", tableMode);
|
||||
const reply = resolveSendableOutboundReplyParts(payload, {
|
||||
text: core.channel.text.convertMarkdownTables(payload.text ?? "", tableMode),
|
||||
});
|
||||
const chunkMode = core.channel.text.resolveChunkMode(config, "zalo", accountId);
|
||||
await deliverTextOrMediaReply({
|
||||
payload,
|
||||
text,
|
||||
text: reply.text,
|
||||
chunkText: (value) =>
|
||||
core.channel.text.chunkMarkdownTextWithMode(value, ZALO_TEXT_LIMIT, chunkMode),
|
||||
sendText: async (chunk) => {
|
||||
|
||||
Reference in New Issue
Block a user