This app demonstrates how to build something similar to Slack's custom response feature.
Once your app is installed in a Slack workspace, end-users can access the app's Home tab. They can maintain custom responses there:
Invite the app's bot user to the channels where you'd like to enable this app. Now it's ready! Whenever an end-user posts a message that contains a registered keyword in the channel, the app replies to it using the registered response text.
Head to https://api.slack.com/apps and create a new app using app-manifest.yml in this repo.
Go to Settings > Basic Information > App-Level Tokens, and click the "Generate Token and Scopes" button.
You can generate a new token with the connections:write
scope and save it as the SLACK_APP_TOKEN
env variable when running your app.
Go to Settings > Install App and click "Install to Workspace" button.
Once the installation completes, save the "Bot User OAuth Token" string as the SLACK_BOT_TOKEN
env variable.
Please note that you need Python 3.6 or newer to run this app. You can follow the steps below to start the app:
export SLACK_APP_TOKEN=xapp-...
export SLACK_BOT_TOKEN=xoxb-...
pip install -r requirements.txt
python app.py
Lastly, please don't forget to invite this app's bot user to the channels where you want to enable this app's responses.
The MIT License