@liflig/cdk
    Preparing search index...

    Class SlackMention

    Slack mention formatter with validation per Slack API format: https://docs.slack.dev/messaging/formatting-message-text/

    Supported mention types:

    • Special mentions: @here, @channel,
    • User IDs: U or W prefix + alphanumeric (e.g., U024BE7LH, W024BE7LH)
    • User group IDs: S prefix + alphanumeric (e.g., SAZ94GDB8)

    Usage: SlackMention.format(['@here', 'U024BE7LH', 'SAZ94GDB8'])

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Format an array of mentions into a single Slack-formatted string.

      Parameters

      • mentions: string[]

        Array of mention strings

      Returns string

    • Format a mention string for Slack API message format. Validates format and converts to proper Slack markup: '@here' -> '' 'U1234567890' -> '<@U1234567890>' 'S1234567890' -> ''

      Parameters

      • mention: string

        Mention string (e.g., '@here', 'U1234567890', 'S1234567890')

      Returns string

      if mention format is invalid