Simple sample of a Slack bot using go
and rabbitMQ
.
-
Create an app: https://api.slack.com/apps
-
Fill
App-name
andworkspace
. -
Select
Event Subscriptions
and enable it. -
Provide your app URL at
Request URL
. (FQDN with the valid certificate) -
Validate URL ... Missing some steps and screen-shots ...
-
Fill
.env
file to feed your docker-compose topology -
Deploy your host topology docker-compose
Current server is a simple echo bot, that anything you send to the bot will be sent back to you. Internally, it is more than that. This sample allow you to receive events from
slack
, they are all sent to a rabbitMQ queue, then you can process it, send to another rabbitMQ queue an the writer will send this messages to slack.
BOT_USER_ID=UXXXXXXXXX
SLACK_TOKEN=xxxx-111111111111-111111111111-XxXxXxXxXxXxXxXxXxXxXxXx
QUEUE_HOSTNAME=queuem
QUEUE_USER=guest
QUEUE_PASSWORD=guest
PUBLIC_DOMAIN=yoursite.com
git clone git@github.com:6za/slack-rabbit.git
cd slack-rabbit
export BASE_DIR=$PWD
./build.sh
docker-compose up
Subscribe to events: