logginghandler/vendor/github.com/slack-go/slack
Marvin Preuss d095180eb4
All checks were successful
continuous-integration/drone/push Build is passing
build: uses go modules for tool handling
2022-01-14 13:51:56 +01:00
..
internal build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
slackutilsx build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
.gitignore build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
.golangci.yml build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
admin.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
apps.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
attachments.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
audit.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
auth.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_action.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_context.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_conv.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_divider.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_element.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_file.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_header.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_image.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_input.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_object.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_rich_text.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_section.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block_unknown.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
block.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
bots.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
CHANGELOG.md build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
channels.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
chat.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
comment.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
conversation.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
dialog_select.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
dialog_text.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
dialog.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
dnd.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
emoji.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
errors.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
files.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
go.mod build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
go.sum build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
groups.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
history.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
im.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
info.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
interactions.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
item.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
LICENSE build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
logger.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
logo.png build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
Makefile build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
messageID.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
messages.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
misc.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
oauth.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
pagination.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
pins.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
reactions.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
README.md build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
reminders.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
rtm.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
search.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
security.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
slack.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
slash.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
socket_mode.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
stars.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
team.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
TODO.txt build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
usergroups.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
users.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
views.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
webhooks_go112.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
webhooks_go113.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
webhooks.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_channels.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_desktop_notification.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_dm.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_dnd.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_files.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_groups.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_internals.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_managed_conn.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_misc.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_mobile_in_app_notification.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_pins.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_reactions.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_stars.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_subteam.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket_teams.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00
websocket.go build: uses go modules for tool handling 2022-01-14 13:51:56 +01:00

Slack API in Go Go Reference

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

You can also chat with us on the #slack-go, #slack-go-ja Slack channel on the Gophers Slack.

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.GetUserGroups(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