Sample slack bot which uses slack interactive message (button & menue) written in Golang
Switch branches/tags
Nothing to show
Clone or download
Latest commit cd4a729 May 19, 2017
Permalink
Failed to load latest commit information.
.gitignore Add dependencies May 19, 2017
Dockerfile Initial commit May 18, 2017
Gopkg.lock Add dependencies May 19, 2017
Gopkg.toml Add dependencies May 19, 2017
README.md Update README.md May 19, 2017
beerbot.gif Initial commit May 18, 2017
cloudbuild.yaml Initial commit May 18, 2017
handler.go Initial commit May 18, 2017
main.go Initial commit May 18, 2017
slack.go Initial commit May 18, 2017

README.md

Slack interactive message in Golang

This is sample slack bot which uses slack interactive message written in Golang. To run this bot, you need to create a bot as slack app. To create slack app only for your team, you can use internal integrations (No OAuth required. This code does not implement it, so if you want to distribute it, you need to write it by yourself). Create a new app from here. The following is how this bot works. Feel free to fork this repository and write your own! Cheers 🍺

(NOTE: Order is fake...)

Usage

To run this bot, you need to set the following env vars,

export BOT_ID="U***"             // you can get this after create a bot user (via slack app management console)
export BOT_TOKEN="xoxb-***"      // you can get this after create a bot user (via slack app management console)
export VERIFICATION_TOKEN="***"  // you can get this after enable interactive message (via slack app management console)
export CHANNEL_ID="C***"         // bot reacts only this channel

To run this,

$ dep ensure
$ go build -o bot && ./bot

To run this local, use ngrok (See more about it here) and set it for interactive message requests endpoint.

References