(text: string)
| 9 | |
| 10 | import { htmlEscape } from "@utils/htmlEscape"; |
| 11 | |
| 12 | // HTML转义函数 |
| 13 | // Telegram 长消息处理 |
| 14 | const MAX_MESSAGE_LENGTH = 4096; |
| 15 | function splitMessage(text: string): string[] { |
| 16 | if ((text || "").length <= MAX_MESSAGE_LENGTH) return [text]; |
| 17 | const parts: string[] = []; |
| 18 | let current = ""; |
| 19 | for (const line of (text || "").split("\n")) { |
| 20 | if ((current + (current ? "\n" : "") + line).length > MAX_MESSAGE_LENGTH) { |
| 21 | parts.push(current); |
no outgoing calls
no test coverage detected