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/slack-go/slack
Wim 6a3fc71397
Update dependencies and go1.18 (#1873)
* Update dependencies and go1.18

* Exclude unnecessary linters and update build to go1.18
2 years ago
..
internal Update dependencies (#1851) 2 years ago
slackutilsx Update dependencies (#1813) 2 years ago
.gitignore Use upstream slack-go/slack again (#1018) 4 years ago
.golangci.yml Update vendor for next release (#1343) 3 years ago
CHANGELOG.md Update vendor (#1257) 4 years ago
LICENSE Use upstream slack-go/slack again (#1018) 4 years ago
Makefile Update vendor slack-go/slack (#1068) 4 years ago
README.md Update dependencies (#1851) 2 years ago
TODO.txt Use upstream slack-go/slack again (#1018) 4 years ago
admin.go Use upstream slack-go/slack again (#1018) 4 years ago
apps.go Update dependencies (#1813) 2 years ago
attachments.go Update vendor (#1461) 3 years ago
audit.go Update dependencies (#1813) 2 years ago
auth.go Update vendor slack-go/slack (#1068) 4 years ago
block.go Update dependencies/vendor (#1659) 3 years ago
block_action.go Update vendor for next release (#1343) 3 years ago
block_context.go Update dependencies (#1610) 3 years ago
block_conv.go Update dependencies and vendor (#1761) 2 years ago
block_divider.go Use upstream slack-go/slack again (#1018) 4 years ago
block_element.go Update dependencies (#1813) 2 years ago
block_file.go Update vendor slack-go/slack (#1068) 4 years ago
block_header.go Update vendor (#1228) 4 years ago
block_image.go Update dependencies for 1.18.0 release (#1175) 4 years ago
block_input.go Update dependencies (#1851) 2 years ago
block_object.go Update dependencies (#1813) 2 years ago
block_rich_text.go Update dependencies/vendor (#1659) 3 years ago
block_section.go Use upstream slack-go/slack again (#1018) 4 years ago
block_unknown.go Update vendor slack-go/slack (#1068) 4 years ago
bookmarks.go Update dependencies (#1851) 2 years ago
bots.go Use upstream slack-go/slack again (#1018) 4 years ago
channels.go Update vendor (#1461) 3 years ago
chat.go Update dependencies and go1.18 (#1873) 2 years ago
comment.go Use upstream slack-go/slack again (#1018) 4 years ago
conversation.go Update dependencies and go1.18 (#1873) 2 years ago
dialog.go Update vendor (#1265) 4 years ago
dialog_select.go Update vendor (#1560) 3 years ago
dialog_text.go Use upstream slack-go/slack again (#1018) 4 years ago
dnd.go Use upstream slack-go/slack again (#1018) 4 years ago
emoji.go Use upstream slack-go/slack again (#1018) 4 years ago
errors.go Update vendor (#1228) 4 years ago
files.go Update dependencies (#1813) 2 years ago
groups.go Update vendor (#1461) 3 years ago
history.go Update dependencies / vendor (#1146) 4 years ago
im.go Update vendor (#1461) 3 years ago
info.go Update dependencies (#1813) 2 years ago
interactions.go Update dependencies (#1813) 2 years ago
item.go Use upstream slack-go/slack again (#1018) 4 years ago
logger.go Update vendor for next release (#1343) 3 years ago
logo.png Update vendor (#1257) 4 years ago
messageID.go Update dependencies (#1813) 2 years ago
messages.go Update dependencies and go1.18 (#1873) 2 years ago
metadata.go Update dependencies and go1.18 (#1873) 2 years ago
misc.go Update dependencies (#1851) 2 years ago
oauth.go Update dependencies and vendor (#1761) 2 years ago
pagination.go Use upstream slack-go/slack again (#1018) 4 years ago
pins.go Use upstream slack-go/slack again (#1018) 4 years ago
reactions.go Use upstream slack-go/slack again (#1018) 4 years ago
reminders.go Update dependencies (#1813) 2 years ago
remotefiles.go Update dependencies (#1851) 2 years ago
rtm.go Use upstream slack-go/slack again (#1018) 4 years ago
search.go Use upstream slack-go/slack again (#1018) 4 years ago
security.go Update vendor for next release (#1343) 3 years ago
slack.go Update vendor (#1461) 3 years ago
slash.go Update vendor (#1265) 4 years ago
socket_mode.go Update vendor (#1384) 3 years ago
stars.go Use upstream slack-go/slack again (#1018) 4 years ago
status_code_error.go Update dependencies (#1851) 2 years ago
team.go Use upstream slack-go/slack again (#1018) 4 years ago
usergroups.go Update dependencies and go1.18 (#1873) 2 years ago
users.go Update dependencies and go1.18 (#1873) 2 years ago
views.go Update dependencies (#1851) 2 years ago
webhooks.go Update dependencies (#1851) 2 years ago
websocket.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_channels.go Update vendor slack-go/slack (#1068) 4 years ago
websocket_desktop_notification.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_dm.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_dnd.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_files.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_groups.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_internals.go Update vendor (#1414) 3 years ago
websocket_managed_conn.go Update dependencies and go1.18 (#1873) 2 years ago
websocket_misc.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_mobile_in_app_notification.go Update vendor slack-go/slack (#1068) 4 years ago
websocket_pins.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_reactions.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_stars.go Use upstream slack-go/slack again (#1018) 4 years ago
websocket_subteam.go Update dependencies (#1851) 2 years ago
websocket_teams.go Use upstream slack-go/slack again (#1018) 4 years ago
workflow_step.go Update dependencies (#1813) 2 years ago
workflow_step_execute.go Update dependencies and go1.18 (#1873) 2 years ago

README.md

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(slack.GetUserGroupsOptionIncludeUsers(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 Socket Mode usage:

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

Minimal RTM usage:

As mentioned in https://api.slack.com/rtm - for most applications, Socket Mode is a better way to communicate with Slack.

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

Socketmode Event Handler (Experimental)

When using socket mode, dealing with an event can be pretty lengthy as it requires you to route the event to the right place.

Instead, you can use SocketmodeHandler much like you use an HTTP handler to register which event you would like to listen to and what callback function will process that event when it occurs.

See ./examples/socketmode_handler/socketmode_handler.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