Skip to content

The open alternative to Salesforce, designed for AI.

368 B
Raw Blame
const SLACK_ASSISTANT_REQUEST_NAME_MAX_LENGTH = 60;

export const buildSlackAssistantRequestName = (requestText: string): string => {
  const codePoints = [...requestText];

  if (codePoints.length <= SLACK_ASSISTANT_REQUEST_NAME_MAX_LENGTH) {
    return requestText;
  }

  return `${codePoints.slice(0, SLACK_ASSISTANT_REQUEST_NAME_MAX_LENGTH - 1).join('')}…`;
};