Skip to content

Flyclops/slack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack GoDoc

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

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)
  channel, err := api.FindChannelByName(channelName)
  if err != nil {
    panic(err)
  }
  err = api.ChatPostMessage(channel.Id, "Hello, world!", nil)
  if err != nil {
    panic(err)
  }
}

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%