Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 927 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 927 Bytes

GoDoc

slack-go-webhook

Go Lang library to send messages to Slack via Incoming Webhooks.

Usage

package main

import "github.com/woopla/slack-go-webhook"

func main() {
  attachment1 := slack.Attachment {}
  attachment1.
    AddField(slack.Field { Title: "Author", Value: "Clément Moyroud" }).
    AddField(slack.Field { Title: "Status", Value: "Completed" })

  payload := slack.Payload("Hello from <https://github.com/woopla/slack-go-webhook|slack-go-webhook>, a Go-Lang library to send slack webhook messages.",
                           "golang-bot",
                           "",
                           "golang-test",
                           []slack.Attachment { attachment1 })


  slack.Send("https://hooks.slack.com/services/foo/bar/baz", "", payload)
}