mirror of https://github.com/openclaw/openclaw.git
15 lines
436 B
TypeScript
15 lines
436 B
TypeScript
import { getQQBotRuntime } from "./runtime.js";
|
|
|
|
/** Maximum text length for a single QQ Bot message. */
|
|
export const TEXT_CHUNK_LIMIT = 5000;
|
|
|
|
/**
|
|
* Markdown-aware text chunking.
|
|
*
|
|
* Delegates to the SDK chunker so code fences and bracket balance stay intact.
|
|
*/
|
|
export function chunkText(text: string, limit: number): string[] {
|
|
const runtime = getQQBotRuntime();
|
|
return runtime.channel.text.chunkMarkdownText(text, limit);
|
|
}
|