workgroups/vendor/github.com/slack-go/slack
Marvin Preuss 1d4ae27878
All checks were successful
continuous-integration/drone/push Build is passing
ci: drone yaml with reusable anchors
2021-09-24 17:34:17 +02:00
..
internal ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
slackutilsx ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
.gitignore ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
.golangci.yml ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
admin.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
apps.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
attachments.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
audit.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
auth.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_action.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_context.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_conv.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_divider.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_element.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_file.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_header.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_image.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_input.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_object.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_section.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block_unknown.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
block.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
bots.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
CHANGELOG.md ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
channels.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
chat.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
comment.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
conversation.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
dialog_select.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
dialog_text.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
dialog.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
dnd.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
emoji.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
errors.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
files.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
groups.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
history.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
im.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
info.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
interactions.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
item.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
LICENSE ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
logger.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
logo.png ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
Makefile ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
messageID.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
messages.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
misc.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
oauth.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
pagination.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
pins.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
reactions.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
README.md ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
reminders.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
rtm.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
search.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
security.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
slack.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
slash.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
socket_mode.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
stars.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
team.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
TODO.txt ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
usergroups.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
users.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
views.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
webhooks_go112.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
webhooks_go113.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
webhooks.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_channels.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_desktop_notification.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_dm.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_dnd.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_files.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_groups.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_internals.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_managed_conn.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_misc.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_mobile_in_app_notification.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_pins.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_reactions.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_stars.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_subteam.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket_teams.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00
websocket.go ci: drone yaml with reusable anchors 2021-09-24 17:34:17 +02:00

Slack API in Go Go Reference

This is the original Slack library for Go created by Norberto Lopes, 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 or Releases 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