The original Slack library for Go created by Norberto Lopes, transferred to a Github organization

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

Similar Resources

Slack remind generator

slack-reminder Slack remind generator slack-reminder.mov Why Slack's /reminder is very hard to use. Required Go 1.16 ~ Installation $ go install githu

Nov 17, 2022

🦎 A slack bot for random gex quotes

🦎 A slack bot for random gex quotes

Jan 3, 2022

Golang bot that connects to slack using Socketclient to read and write messages.

Golang bot that connects to slack using Socketclient to read and write messages.

🚀 (not)simple go project 🚀 Golang bot that connects to slack using Socketclient to read and write messages. 🏆 Use 🏆 @SquidBot : Mentions your name

Aug 23, 2022

Send Slack reports of pull requests pending review

Send Slack reports of pull requests pending review

preport Born out of a desire to get pull requests reviewed faster without having to send manual reminders, preport generates reports of GitLab pull re

Nov 23, 2021

Notify Slack about KPIs test

Notify Slack about KPIs test

This action is a part of GitHub Actions Library created by rtCamp. Slack Notify - GitHub Action A GitHub Action to send a message to a Slack channel.

Jan 10, 2022

Send Linux mails to Slack with golang

LinuxMailToSlack Install go install github.com/TKMAX777/MailToSlack@latest sudo

Jul 30, 2022

Notify messages from gcs bucket objects to slack

Notify to Slack Notify message to slack from gcs storage file. Deploy $ gcloud functions deploy notify_to_slack \ --entry-point NotifyToSlack \

Oct 5, 2021

Slack Export Connection Visualizer

Slack Export Connection Visualizer Prerequisites Golang 1.16+ slack export unzipped into ./data email - department CSV located at ./data/dept.csv Run

Dec 28, 2021

Notify - Notification microservice for sending templated payloads as Slack messages

Notify Notify is a microservice that takes an event & payload from an applicatio

May 23, 2022
REPLbot is a Slack bot that allows you to control a REPL from within Slack.
REPLbot is a Slack bot that allows you to control a REPL from within Slack.

?? REPLbot REPLbot is a Slack bot that allows you to control a REPL from within Slack. It comes with a few REPLs (Go ?? , Java, NodeJS, PHP, Python, R

Dec 31, 2022
This slack-bot collects all @gophers notifications into one slack channel

slack-bot Slack bot copying reference to a ping to notifications channel The bot is designed to listen on messages containing specific tag, copy refer

Apr 11, 2022
Original Apollo 11 Guidance Computer (AGC) source code for the command and lunar modules.

Apollo-11 ?? Bahasa Indonesia, Català, Čeština, Deutsch, English, Español, Français, Italiano, Kurdi, Nederlands, Norsk, Polski, Português, Română, Ti

Dec 29, 2022
send current weather updates from openweathermap api to your slack profile status using github action
send current weather updates from openweathermap api to your slack profile status using github action

go-slack-weather Send current weather updates from OpenWeatherMap API to your Slack profile status using GitHub Action Contents Setup Change Update Pe

Oct 31, 2022
Library for testing interactive Slack applications.

Slackster Library for testing interactive Slack applications. Mock Slack API: user info, post and update message, publish view. Testing Slack UI in th

Aug 17, 2022
Github-trending-bot - Go app to archive daily github trending repos.

GITHUB-TRENDING-BOT Simple application to archive daily github trending repos, written in Go. Project Description Uses Go to parse raw html from the g

Jan 7, 2022
IRC, Slack, Telegram and RocketChat bot written in go
IRC, Slack, Telegram and RocketChat bot written in go

go-bot IRC, Slack & Telegram bot written in Go using go-ircevent for IRC connectivity, nlopes/slack for Slack and Syfaro/telegram-bot-api for Telegram

Dec 20, 2022
Golang Framework for writing Slack bots

hanu - Go for Slack Bots! The Go framework hanu is your best friend to create Slack bots! hanu uses allot for easy command and request parsing (e.g. w

Oct 24, 2022
Slack Bot Framework

slacker Built on top of the Slack API github.com/slack-go/slack with the idea to simplify the Real-Time Messaging feature to easily create Slack Bots,

Dec 25, 2022
Slack bot core/framework written in Go with support for reactions to message updates/deletes
Slack bot core/framework written in Go with support for reactions to message updates/deletes

Overview Requirements Features Demo The Name Concepts Create Your Own Slackscot Assembling the Parts and Bringing Your slackscot to Life Configuration

Oct 28, 2022