0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-01-12 11:38:11 +00:00
crazy-max_diun/vendor/github.com/nlopes/slack
2024-12-14 22:30:21 +01:00
..
internal chore: go mod vendor 2024-12-14 22:30:21 +01:00
slackutilsx chore: go mod vendor 2024-12-14 22:30:21 +01:00
.gitignore chore: go mod vendor 2024-12-14 22:30:21 +01:00
.gometalinter.json chore: go mod vendor 2024-12-14 22:30:21 +01:00
.travis.yml chore: go mod vendor 2024-12-14 22:30:21 +01:00
admin.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
attachments.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
auth.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
backoff.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_action.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_context.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_conv.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_divider.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_element.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_image.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_object.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
block_section.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
bots.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
CHANGELOG.md chore: go mod vendor 2024-12-14 22:30:21 +01:00
channels.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
chat.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
comment.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
conversation.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
dialog.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
dialog_select.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
dialog_text.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
dnd.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
emoji.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
errors.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
files.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
groups.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
history.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
im.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
info.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
interactions.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
item.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
LICENSE chore: go mod vendor 2024-12-14 22:30:21 +01:00
logger.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
messageID.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
messages.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
misc.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
oauth.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
pagination.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
pins.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
reactions.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
README.md chore: go mod vendor 2024-12-14 22:30:21 +01:00
reminders.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
rtm.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
search.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
security.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
slack.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
slash.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
stars.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
team.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
TODO.txt chore: go mod vendor 2024-12-14 22:30:21 +01:00
usergroups.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
users.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
webhooks.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_channels.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_dm.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_dnd.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_files.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_groups.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_internals.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_managed_conn.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_misc.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_pins.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_reactions.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_stars.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_subteam.go chore: go mod vendor 2024-12-14 22:30:21 +01:00
websocket_teams.go chore: go mod vendor 2024-12-14 22:30:21 +01:00

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.

Changelog

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
	// 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/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