Skip to content

The open alternative to Salesforce, designed for AI.

331 B
Raw Blame
import { SLACK_USER_MENTION_PATTERN } from 'src/logic-functions/constants/slack-user-mention-pattern';

export const collectSlackMentionedUserIds = (
  texts: readonly string[],
): string[] => [
  ...new Set(
    texts.flatMap((text) =>
      [...text.matchAll(SLACK_USER_MENTION_PATTERN)].map((match) => match[1]),
    ),
  ),
];