Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 709 Bytes

README.md

File metadata and controls

32 lines (26 loc) · 709 Bytes

Slack

A library for posting consistent Slack messages across the Skpr platform.

Usage

client, err := slack.NewClient([]string{
    "https://hooks.slack.com/services/xxxxxxxxx/yyyyyyyyy/zzzzzzzzz",
})
if err != nil {
    panic(err)
}

params := slack.PostMessageParams{
    Icon: "https://raw.githubusercontent.com/skpr/slack/main/icons/application_drupal.png",
    Context: map[string]string{
        "Account":    "123456789",
        "Anomaly ID": "xxxxxx-yyyyyy-zzzzzz",
    },
    Description: "This is the description field",
    Reason:      "This is the reason field.",
    Dashboard:   "https://skpr.com.au",
}

err = client.PostMessage(params)
if err != nil {
    panic(err)
}