MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / findBestSlackSplitBefore

Method findBestSlackSplitBefore

src/runtime/adapters/slack.ts:687–705  ·  view source on GitHub ↗
(text: string, token: string)

Source from the content-addressed store, hash-verified

685 return Math.max(1, best);
686 }
687
688 private findBestSlackSplitBefore(text: string, token: string): number {
689 let fromIndex = Math.min(text.length, MAX_MESSAGE_LENGTH);
690
691 while (fromIndex > 0) {
692 const index = text.lastIndexOf(token, fromIndex);
693 if (index < 0) {
694 return -1;
695 }
696
697 const splitAt = index + token.length;
698 if (this.isSlackMessageWithinLimit(text.slice(0, splitAt))) {
699 return splitAt;
700 }
701
702 fromIndex = index - 1;
703 }
704
705 return -1;
706 }
707
708 private async tryAckReaction(client: any, event: any): Promise<void> {

Callers 1

Calls 1

Tested by

no test coverage detected