You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
matterbridge/vendor/github.com/nlopes/slack
Patrick Connolly e538a4d304 Update nlopes/slack to 4.1-dev (#595) 6 years ago
..
slackutilsx Update of nlopes/slack dependency (#511) 6 years ago
.gitignore Update nlopes/slack vendor 6 years ago
.travis.yml Update nlopes/slack to 4.1-dev (#595) 6 years ago
CHANGELOG.md Update of nlopes/slack dependency (#511) 6 years ago
Gopkg.lock Update of nlopes/slack dependency (#511) 6 years ago
Gopkg.toml Update of nlopes/slack dependency (#511) 6 years ago
LICENSE Update vendor (slack) 7 years ago
README.md Update nlopes/slack vendor 6 years ago
TODO.txt Use mod vendor for vendored directory (backwards compatible) 6 years ago
admin.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
attachments.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
auth.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
backoff.go Update nlopes/slack vendor 6 years ago
bots.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
channels.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
chat.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
comment.go Update vendor (slack) 7 years ago
conversation.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
dialog.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
dialog_select.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
dialog_text.go Update of nlopes/slack dependency (#511) 6 years ago
dnd.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
emoji.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
files.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
groups.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
history.go Update vendor (slack) 7 years ago
im.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
info.go Update nlopes/slack vendor 6 years ago
interactions.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
item.go Update vendor (slack) 7 years ago
logger.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
messageID.go Update vendor (slack) 7 years ago
messages.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
misc.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
oauth.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
pagination.go Update vendor (slack) 7 years ago
pins.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
reactions.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
rtm.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
search.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
security.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
slack.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
slash.go Update nlopes/slack vendor 6 years ago
stars.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
team.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
usergroups.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
users.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
webhooks.go Update of nlopes/slack dependency (#511) 6 years ago
websocket.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
websocket_channels.go Update vendor (slack) 7 years ago
websocket_dm.go Update vendor (slack) 7 years ago
websocket_dnd.go Update vendor (slack) 7 years ago
websocket_files.go Update vendor (slack) 7 years ago
websocket_groups.go Update vendor (slack) 7 years ago
websocket_internals.go Update nlopes/slack vendor 6 years ago
websocket_managed_conn.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
websocket_misc.go Update nlopes/slack to 4.1-dev (#595) 6 years ago
websocket_pins.go Update vendor (slack) 7 years ago
websocket_reactions.go Update vendor (slack) 7 years ago
websocket_stars.go Update vendor (slack) 7 years ago
websocket_subteam.go Update of nlopes/slack dependency (#511) 6 years ago
websocket_teams.go Update vendor (slack) 7 years ago

README.md

Slack API in Go GoDoc Build Status

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

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.

Change log

Support for the EventsAPI has recently been added. It is still in its early stages but nearly all events have been added and tested (except for those events in Developer Preview mode). API stability for events is not promised at this time.

v0.2.0 - Feb 10, 2018

Release adds a bunch of functionality and improvements, mainly to give people a recent version to vendor against.

Please check 0.2.0

CHANGELOG.md

CHANGELOG.md is available. Please visit it for updates.

Installing

go get

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

Example

Getting all groups

import (
	"fmt"

	"github.com/nlopes/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
	// api.SetDebug(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/nlopes/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/nlopes/slack/blob/master/examples/websocket/websocket.go

Minimal EventsAPI usage:

See https://github.com/nlopes/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.

License

BSD 2 Clause license