A tool can connect to public Slack channels for storing messages with threads and interacts with specific slack actions eg:
- can reply for main or thread a message
- can create and print basic statistics
- can pop up a custom form where you can a specific question for a requestor
- etc. If you use Slack channel as support channel this tool should perfectly fit for you.
Features:
- Monitoring Slack channel - e.g. you can control your slack support channel
- Framework intercepts Slack messages, labels and stores messages
- Allows granular monitoring types of requests
- Results can be presented using Grafana framework(some examples attached)
- Create db (currently the tool supports only MySql)
- local db for testing
docker run --name slack011y-bus-db -d \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=change-me \ -v slack011y-bus:/var/lib/docker/volumes/volumename/_data mysql:8
docker exec -it <docker-id> sh -c "mysql --user=root --password=change-me"
- create database and slack user
CREATE DATABASE slacky_bus; CREATE USER 'slacky_bus_user'@'%' IDENTIFIED BY 'slacky_bus_user'; GRANT ALL PRIVILEGES ON slacky_bus.* TO 'slacky_bus_user'@'%';
- run the script slack-bus/db.sql
- send the db details to environments
export DB_USER= export DB_PASSWD= export DB_HOST= export DB_DB= export DB_PORT=
- local db for testing
- Setup Slack to allow collecting data
- Go to https://api.slack.com/apps/
- Create a "new webapp" - https://api.slack.com/authentication/basics#creating
- Create an app "from scratch"
- Add "App Name" and pick the "workspace from the list"
- Go to https://api.slack.com/apps//oauth? and export following items:
- Add "Scopes/Bot Token Scopes"
- Click "install to workspace" on first widget
- export SLACK_TOKEN <- "Bot User OAuth Token"
*
export SLACK_TOKEN=xoxb-.. export SLACK_WORKSPACE_NAME= ```
- export SIGNING_SECRET < "Signing Secret" from https://api.slack.com/apps//general?
*
export SIGNING_SECRET=xxx ```
- Go to https://api.slack.com/apps//event-subscriptions?
- Switch a toggle to "on"
- Add url which will be used for intercepting messages (use ngrok for local testing)
- keep the "/slack/events" as url suffix
- e.g. "https://2137-18-134-225-225.ngrok.io/slack/events"
- Go to "Subscribe to bot events" tab
- Add Bot User Event
- Slack-Bus app requires following permissions
- Go to https://api.slack.com/apps//interactive-messages?
- Add url which will be used for intercepting messages (use ngrok for local testing)
- keep the "slack/interactive-endpoints" as url suffix
- e.g. "https://2137-18-134-225-225.ngrok.io/slack/interactive-endpoints"
- Add url which will be used for intercepting messages (use ngrok for local testing)
- Add apps to your Slack workspace
- Add slack011y-bus to channel
- The configuration can be handled by
- api
- swagger - http:///admin/api/v1/swagger/
- Add a channel to the slack-bus app
- use swagger "channels" to see more options
-
curl -X 'POST' \ 'http://<slack011y-bus-url>/admin/api/v1/channels/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "channel_id": "BOGUS_CHANNEL_ID", "channel_name": "slack011y-bus-test" }'
- track messages with emojis (swagger can help with this as well) - set action for specific emoji(request type)
- swagger - http:///admin/api/v1/swagger/ - "types" to see more options
-
curl -X 'POST' \ 'http://<slack011y-bus-url>/admin/api/v1/channels/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "types": { "not_selected_response": "You haven't selected a type for your message.", "emojis": { "additionalProp1": { "emoji": "U+1F198", "alias": "sos", "image": "cloud-pr.png", "color": "#619BFF", "meaning": "Need help" } }
- adding custom question form for getting some more details about asking issue
- recommendations - based on questions form answers we can prepare common recommendations for requestors
- swagger - http:///admin/api/v1/swagger/ - "types" to see more options
- a custom emoji reaction which we can add to main message - it triggers changing reqeust status from "initial" to "working"
- swagger - http:///admin/api/v1/swagger/ - "start_reactions" to see more options
- a custom emoji reaction which we can add to main message - it triggers changing reqeust status from "working" to "completed"
- swagger - http:///admin/api/v1/swagger/ - "completion_reactions" to see more options
- crom job which change status to "closed" for unclosed idle messages - if there is no any thread reaction for the request in defined period of time, the user will be informed and the message will be closed