How to connect Chatbot to Slack
See Japanese README
Supporting chatbot message is only default reply.
1. Set chatbot service endpoint & secret key to this application.
Chatbot and API Gateway integration.
Set your chatbot service endpoint to CHATBOT_ENDPOINT that is environment variable.
Set your secret key to CHATBOT_SECRET_KEY that is environment variable.
2. Create your slack app & set it's config to this application.
Open https://api.slack.com/apps & click [Create an App].
Enter new chatbot app name & select development workspace & click [Create App]
Set your config to environment variable. It can get from [App Credentials] under [Basic Information] page.
Set Client ID to SLACK_CLIENT_ID.
Set Client Secret to SLACK_CLIENT_SECRET.
Set Signing Secret to SLACK_SIGNING_SECRET.
3. Publish this application.
In this case, using ngrok.
Install ngrok.
Start ngrok service.
Copy published https domain.
Start this application.
# install requirements
pip install -r requirements.txt
# run application
python app.py
4. Set slack application config.
Open https://api.slack.com/apps . & click your slack application. & redirect to it's setting page.
Click [OAuth & Permissions] from [Features]. & set copied No.3-3 domain and authorization endpoint to [Redirect URLs] like an image.
Set application scope under [OAuth & Permissions] page. The setting is like an image.
Click [Event Subscriptions] from [Features]
enable [Enable Events]. & set copied No.3-3 domain and slack event endpoint to [Redirect URLs] like an image. & check Verified.
Click [Subscribe to bot events] & add Bot User Event. The setting is like an image. & Click [Save Changes]
Click [Manage Distribution] from [Settings]. & click [Add to Slack]. & redirect to access permission page.
Click [Allow]. & check [Auth complete!]
Open your workspace. & check existing your slack bot application.
5. Let's talk with slack bot