Skip to content

TechneDevAB/slack

 
 

Repository files navigation

Slack GoDoc

Golang client for the Slack API. Include the example code using each slack api.

Modifications:

  • HTTP client is initialized differently when building for Google App Engine

Currently supports:

Method Description Example
channels.history Fetches history of messages and events from a channel. #link
channels.join Joins a channel, creating it if needed. #link
channels.list Lists all channels in a Slack team. #link
chat.postMessage Sends a message to a channel. #link
files.upload Upload an image/file #link
groups.invite Invites a user to a private group. #link
groups.create Creates a private group. #link
groups.list Lists private groups that the calling user has access to. #link
users.info Gets information about a channel. #link
users.list Lists all users in a Slack team. #link

Example

package main

import (
  "github.com/bluele/slack"
)

const (
  token       = "your-api-token"
  channelName = "general"
)

func main() {
  api := slack.New(token)
  err := api.ChatPostMessage(channelName, "Hello, world!", nil)
  if err != nil {
    panic(err)
  }
}

Command line tool

If you are looking for slack commandline utility, vektorlab/slackcat probably suits you.

Author

Jun Kimura

About

Golang client for the Slack API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%