Skip to content
forked from slack-go/slack

Slack API in Go - community-maintained fork created by the original author, @nlopes

License

Notifications You must be signed in to change notification settings

hagaishapira/slack

This branch is 745 commits behind slack-go/slack:master.

Folders and files

NameName
Last commit message
Last commit date
Feb 24, 2020
Oct 2, 2020
Apr 4, 2019
Oct 1, 2020
Aug 15, 2020
Oct 23, 2020
May 28, 2020
Jul 14, 2018
Jan 7, 2019
Apr 19, 2020
Oct 2, 2020
Jan 24, 2015
Mar 8, 2020
Oct 2, 2020
Aug 16, 2015
Apr 4, 2019
Oct 5, 2020
Oct 1, 2020
Aug 5, 2020
Sep 30, 2020
Nov 12, 2019
Apr 4, 2019
Jul 30, 2020
May 8, 2019
May 8, 2019
May 8, 2019
May 8, 2019
Aug 18, 2020
May 8, 2019
Feb 27, 2019
Oct 2, 2020
Aug 18, 2020
Feb 19, 2020
Feb 19, 2020
Jul 30, 2020
Jul 30, 2020
Apr 26, 2020
Aug 18, 2020
Feb 20, 2020
Feb 20, 2020
Oct 2, 2020
Aug 18, 2020
Jun 23, 2019
Aug 18, 2020
May 8, 2019
Feb 27, 2020
Nov 2, 2019
Nov 2, 2019
Dec 9, 2019
Oct 2, 2020
Aug 18, 2020
Jul 22, 2015
Sep 2, 2020
Aug 9, 2019
Oct 9, 2020
Aug 9, 2019
Apr 13, 2019
Aug 9, 2019
Aug 9, 2019
Aug 9, 2019
Apr 4, 2019
Apr 4, 2019
Apr 4, 2019
Apr 4, 2019
May 11, 2020
Aug 31, 2019
Aug 31, 2019
May 28, 2020
Sep 12, 2020
Apr 14, 2020
Nov 2, 2019
Apr 13, 2019
Mar 2, 2020
Oct 13, 2020
Oct 9, 2020
Jul 26, 2015
Jul 22, 2015
Oct 6, 2018
Oct 6, 2018
Oct 2, 2020
Aug 16, 2015
Oct 2, 2020
Sep 9, 2020
Sep 19, 2020
Feb 16, 2020
Aug 14, 2020
Jan 27, 2015
Apr 4, 2019
Apr 4, 2019
Apr 4, 2019
Apr 4, 2019
Oct 6, 2020
Oct 1, 2020
Nov 2, 2019
Nov 2, 2019
Apr 2, 2019
Nov 4, 2018
Oct 5, 2020
Jan 24, 2015
Oct 13, 2020
Oct 13, 2020
Sep 1, 2019
Apr 4, 2019
Apr 4, 2019
Apr 4, 2019
Feb 24, 2020
Apr 4, 2019
Jul 5, 2020
Jul 5, 2020
May 11, 2020
Sep 29, 2020
Apr 22, 2020
Feb 17, 2020
Feb 17, 2020
Apr 22, 2020
Nov 2, 2019
Mar 2, 2020
Nov 6, 2019
Aug 3, 2015
Mar 5, 2016
Jan 30, 2016
Aug 16, 2015
Aug 31, 2019
Mar 17, 2020
Feb 16, 2020
Nov 2, 2019
Jan 22, 2020
Jan 30, 2016
Mar 5, 2016
Jan 30, 2016
Sep 4, 2018
Mar 5, 2016

Repository files navigation

Slack API in Go GoDoc Build Status

This is the original Slack library for Go created by Norberto Lopez, transferred to a Github organization.

Join the chat at https://gitter.im/go-slack/Lobby

logo

This library supports most if not all of the api.slack.com REST calls, as well as the Real-Time Messaging protocol over websocket, in a fully managed way.

Project Status

There is currently no major version released. Therefore, minor version releases may include backward incompatible changes.

See CHANGELOG.md for more information about the changes.

Installing

go get

$ go get -u github.com/slack-go/slack

Example

Getting all groups

import (
	"fmt"

	"github.com/slack-go/slack"
)

func main() {
	api := slack.New("YOUR_TOKEN_HERE")
	// If you set debugging, it will log all requests to the console
	// Useful when encountering issues
	// slack.New("YOUR_TOKEN_HERE", slack.OptionDebug(true))
	groups, err := api.GetGroups(false)
	if err != nil {
		fmt.Printf("%s\n", err)
		return
	}
	for _, group := range groups {
		fmt.Printf("ID: %s, Name: %s\n", group.ID, group.Name)
	}
}

Getting User Information

import (
    "fmt"

    "github.com/slack-go/slack"
)

func main() {
    api := slack.New("YOUR_TOKEN_HERE")
    user, err := api.GetUserInfo("U023BECGF")
    if err != nil {
	    fmt.Printf("%s\n", err)
	    return
    }
    fmt.Printf("ID: %s, Fullname: %s, Email: %s\n", user.ID, user.Profile.RealName, user.Profile.Email)
}

Minimal RTM usage:

See https://github.com/slack-go/slack/blob/master/examples/websocket/websocket.go

Minimal EventsAPI usage:

See https://github.com/slack-go/slack/blob/master/examples/eventsapi/events.go

Contributing

You are more than welcome to contribute to this project. Fork and make a Pull Request, or create an Issue if you see any problem.

Before making any Pull Request please run the following:

make pr-prep

This will check/update code formatting, linting and then run all tests

License

BSD 2 Clause license

About

Slack API in Go - community-maintained fork created by the original author, @nlopes

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.7%
  • Makefile 0.3%