5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 10:30:26 +00:00
matterbridge/vendor/github.com/slack-go/slack
2022-11-27 00:42:16 +01:00
..
internal Update dependencies (#1929) 2022-11-27 00:42:16 +01:00
slackutilsx Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
.gitignore Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
.golangci.yml Update vendor for next release (#1343) 2020-12-31 14:48:12 +01:00
admin.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
apps.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
attachments.go Update vendor (#1461) 2021-05-05 22:03:28 +02:00
audit.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
auth.go Update vendor slack-go/slack (#1068) 2020-03-28 23:50:47 +01:00
block_action.go Update vendor for next release (#1343) 2020-12-31 14:48:12 +01:00
block_context.go Update dependencies (#1610) 2021-10-17 00:47:22 +02:00
block_conv.go Update dependencies and vendor (#1761) 2022-03-12 19:41:07 +01:00
block_divider.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
block_element.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
block_file.go Update vendor slack-go/slack (#1068) 2020-03-28 23:50:47 +01:00
block_header.go Update vendor (#1228) 2020-09-04 23:29:13 +02:00
block_image.go Update dependencies for 1.18.0 release (#1175) 2020-07-18 17:27:41 +02:00
block_input.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
block_object.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
block_rich_text.go Update dependencies/vendor (#1659) 2021-12-12 00:05:15 +01:00
block_section.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
block_unknown.go Update vendor slack-go/slack (#1068) 2020-03-28 23:50:47 +01:00
block.go Update dependencies/vendor (#1659) 2021-12-12 00:05:15 +01:00
bookmarks.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
bots.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
CHANGELOG.md Update vendor (#1257) 2020-10-11 23:07:00 +02:00
channels.go Update vendor (#1461) 2021-05-05 22:03:28 +02:00
chat.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
comment.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
conversation.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
dialog_select.go Update vendor (#1560) 2021-07-31 18:27:55 +02:00
dialog_text.go Update dependencies (#1929) 2022-11-27 00:42:16 +01:00
dialog.go Update vendor (#1265) 2020-10-19 23:40:00 +02:00
dnd.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
emoji.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
errors.go Update vendor (#1228) 2020-09-04 23:29:13 +02:00
files.go Update dependencies (#1929) 2022-11-27 00:42:16 +01:00
groups.go Update vendor (#1461) 2021-05-05 22:03:28 +02:00
history.go Update dependencies / vendor (#1146) 2020-05-24 00:06:21 +02:00
im.go Update vendor (#1461) 2021-05-05 22:03:28 +02:00
info.go Update dependencies (#1929) 2022-11-27 00:42:16 +01:00
interactions.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
item.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
LICENSE Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
logger.go Update vendor for next release (#1343) 2020-12-31 14:48:12 +01:00
logo.png Update vendor (#1257) 2020-10-11 23:07:00 +02:00
Makefile Update vendor slack-go/slack (#1068) 2020-03-28 23:50:47 +01:00
messageID.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
messages.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
metadata.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
misc.go Update dependencies (#1929) 2022-11-27 00:42:16 +01:00
oauth.go Update dependencies and vendor (#1761) 2022-03-12 19:41:07 +01:00
pagination.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
pins.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
reactions.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
README.md Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
reminders.go Update dependencies (#1813) 2022-04-25 23:50:10 +02:00
remotefiles.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
rtm.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
search.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
security.go Update vendor for next release (#1343) 2020-12-31 14:48:12 +01:00
slack.go Update vendor (#1461) 2021-05-05 22:03:28 +02:00
slash.go Update vendor (#1265) 2020-10-19 23:40:00 +02:00
socket_mode.go Update vendor (#1384) 2021-02-01 21:29:04 +01:00
stars.go Update dependencies (#1929) 2022-11-27 00:42:16 +01:00
status_code_error.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
team.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
TODO.txt Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
usergroups.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
users.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
views.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
webhooks.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
websocket_channels.go Update vendor slack-go/slack (#1068) 2020-03-28 23:50:47 +01:00
websocket_desktop_notification.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_dm.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_dnd.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_files.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_groups.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_internals.go Update vendor (#1414) 2021-03-20 22:40:23 +01:00
websocket_managed_conn.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
websocket_misc.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_mobile_in_app_notification.go Update vendor slack-go/slack (#1068) 2020-03-28 23:50:47 +01:00
websocket_pins.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_reactions.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_stars.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket_subteam.go Update dependencies (#1851) 2022-06-25 00:36:16 +02:00
websocket_teams.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
websocket.go Use upstream slack-go/slack again (#1018) 2020-03-01 20:59:19 +01:00
workflow_step_execute.go Update dependencies and go1.18 (#1873) 2022-08-13 16:14:26 +02:00
workflow_step.go Update dependencies (#1813) 2022-04-25 23:50:10 +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.

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