Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/SlackMessages"

Index

Type aliases

ActionType

ActionType: "button" | "select"

DataSource

DataSource: "static" | "users" | "channels" | "conversations" | "external"

MessageMimeType

MessageMimeType: "application/x-atomist-slack+json" | "application/x-atomist-slack-file+json" | "text/plain" | "application/json"

Type defining the MIME types that the Slack message API accepts.

Functions

atChannel

  • atChannel(): string

atEveryone

  • atEveryone(): string

atHere

  • atHere(): string

bold

  • bold(text: string): string

channel

  • channel(channelId: string, channelName?: undefined | string): string
  • Mentions channel (e.g. #general). Will mention specific channel by channelId. When channelName is provided will add readable channel name.

    Parameters

    • channelId: string
    • Optional channelName: undefined | string

    Returns string

codeBlock

  • codeBlock(text: string): string

codeLine

  • codeLine(text: string): string

emoji

  • emoji(name: string): string

escape

  • escape(text: string): string
  • Encode special Slack characters and HTML entities.

    Parameters

    • text: string

    Returns string

italic

  • italic(text: string): string

listItem

  • listItem(item: string): string

render

strikethrough

  • strikethrough(text: string): string

url

  • url(fullUrl: string, label?: undefined | string): string
  • Constructs slack link. Label is automatically escaped.

    Parameters

    • fullUrl: string
    • Optional label: undefined | string

    Returns string

user

  • user(userId: string, userName?: undefined | string): string
  • Mentions user (e.g. @anna). When userName is provided will add readable user name.

    Parameters

    • userId: string

      Slack user ID

    • Optional userName: undefined | string

      alternative user name, which Slack seems to ignore

    Returns string

    properly formatted Slack user mention

Object literals

Const MessageMimeTypes

MessageMimeTypes: object

Helper constants for the MIME types the Slack message API accepts.

ApplicationJson

ApplicationJson: "application/json" = "application/json"

PlainText

PlainText: "text/plain" = "text/plain"

SlackFileJson

SlackFileJson: "application/x-atomist-slack-file+json" = "application/x-atomist-slack-file+json"

SlackJson

SlackJson: "application/x-atomist-slack+json" = "application/x-atomist-slack+json"

Generated using TypeDoc