A Slack Incoming Webhooks client in Go.
$ slack-incoming-webhooks \
-icon-emoji ":ghost:" \
-text "This is posted to #general and comes from a bot named webhookbot." \
YOUR_WEBHOOK_URL
You can use attachment and fields parameters.
$ slack-incoming-webhooks \
-attachment-color "good" \
-attachment-text "This is posted to #general and comes from a bot named webhookbot." \
YOUR_WEBHOOK_URL
$ slack-incoming-webhooks \
-attachment-color "good" \
# First field
-attachment-field-title "Project" \
-attachment-field-value "Awesome Project" \
-attachment-field-short "true" \
# Second field
-attachment-field-title "Environment" \
-attachment-field-value "production" \
-attachment-field-short "true" \
YOUR_WEBHOOK_URL
You can use as a Go library.
import slack "github.com/monochromegane/slack-incoming-webhooks"
func main() {
slack.Client{
WebhookURL: YOUR_WEBHOOK_URL,
}.Post(&slack.Payload{
Text: "Text",
})
}
All Incoming Webhooks and Attachments parameters is supported 🍺 !
See Slack API doc.
$ go get github.com/monochromegane/slack-incoming-webhooks/...
- Fork it
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create new Pull Request