Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SlackWebhookClient

Index

Constructors

constructor

Properties

Readonly axios

axios: AxiosInstance

The underlying axios instance.

Methods

sendAttachment

  • sendAttachment(attachment: Attachment): Promise<"ok">

sendAttachments

  • sendAttachments(attachments: Attachment[]): Promise<"ok">
  • Send multiple attachments which let you add more context to a message.

    see

    https://api.slack.com/docs/message-attachments

    await client.sendAttachments([
    {
    fallback: 'some text',
    pretext: 'some pretext',
    color: 'good',
    fields: [
    {
    title: 'aaa',
    value: 'bbb',
    short: false,
    },
    ],
    },
    {
    fallback: 'some other text',
    pretext: 'some pther pretext',
    color: '#FF0000',
    fields: [
    {
    title: 'ccc',
    value: 'ddd',
    short: false,
    },
    ],
    },
    ]);

    Parameters

    • attachments: Attachment[]

      Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment.

    Returns Promise<"ok">

sendRawBody

  • sendRawBody(body: Record<string, any>): Promise<"ok">

sendText

  • sendText(text: string): Promise<"ok">

Static connect

Generated using TypeDoc