A Flask app to document and test Slack's interactive messages.
Check out our Source article explaining how we use Slack buttons in our newsroom and how you can make your own.
Create a virtualenv to store the codebase.
$ virtualenv slack_buttonsActivate the virtualenv.
$ cd slack_buttons
$ . bin/activateClone the git repository from GitHub.
$ git clone https://github.com/datadesk/slack-buttons-example.git repoEnter the repo and install its dependencies.
$ cd repo
$ pip install -r requirements.txtFill in your Slack app's credentials in the app file.
Now run the test server and check out the results on localhost:5000
$ python app.pyThis Flask app has three routes:
- '/': index is just to test to make sure the server is running
- '/test-add-story': test URL will post a test story in your Slack channel
- '/slack': webhook accepts POST requests from your Slack app after a button has been clicked