(text: string)
| 467 | } |
| 468 | |
| 469 | private splitMessage(text: string): string[] { |
| 470 | if (this.isSlackMessageWithinLimit(text)) { |
| 471 | return [text]; |
| 472 | } |
| 473 | |
| 474 | const chunks: string[] = []; |
| 475 | let remaining = text; |
| 476 | |
| 477 | while (remaining.length > 0) { |
| 478 | if (this.isSlackMessageWithinLimit(remaining)) { |
| 479 | chunks.push(remaining); |
| 480 | break; |
| 481 | } |
| 482 | |
| 483 | let splitAt = this.findSlackSafeSplitPoint(remaining); |
| 484 | |
| 485 | chunks.push(remaining.slice(0, splitAt)); |
| 486 | remaining = remaining.slice(splitAt).trimStart(); |
| 487 | } |
| 488 | |
| 489 | return chunks; |
| 490 | } |
| 491 | |
| 492 | private async sendLongMessage( |
| 493 | client: any, |
no test coverage detected