Demo showing how to use Slack with Now serverless, Python and Flask including call to Slack API
- Python 3
Needed Python packages:
- flask
- json
- slackclient from https://github.com/SlackAPI/python-slackclient (install with
pip3 install slackclient==2.0.0!!)
- Install missing python packages (if any)
- Fork this repo on github
- Connect your now account with your github account
- Make sure the now app on github is connected to your repo
- Once you pushed a change you should get an alias to your repo on the now dashboard
- Create a Slack app in your workspace, add a slash command and use the alias from now as request URL for the slash command
- Add scopes
channels:readandgroups:read - Install your Slack app into your workspace
- Retrieve the token from the Oauth page of your app and set the environment variable SLACK_TOKEN with it
- Add your slack token as secret in the now CLI with
now secret add slack_token xoxp-xxx