MCPcopy Create free account
hub / github.com/clawbot7/cli-gateway / formatTextCodeBlock

Function formatTextCodeBlock

src/channels/discord.ts:1020–1026  ·  view source on GitHub ↗
(text: string, maxLen: number)

Source from the content-addressed store, hash-verified

1018}
1019
1020function formatTextCodeBlock(text: string, maxLen: number): string {
1021 const open = '```text\n';
1022 const close = '\n```';
1023 const safe = text.replace(/```/g, '``\u200b`').trimEnd();
1024 const body = truncate(safe, maxLen - open.length - close.length);
1025 return `${open}${body}${close}`;
1026}
1027
1028type PermissionDecision = 'allow' | 'deny';
1029

Callers 1

Calls 1

truncateFunction · 0.70

Tested by

no test coverage detected