Based on slack-morphism-rust example.
Once installed this this app will reply to any direct message with an identical response.
This is current as of 2021-03-12.
- Create an App
- Add the
chat:write
andim:read
OAuth Scopes under OAuth & Permissions - Install App into your workspace
- Store the Bot User OAuth token (visible under Install App or OAuth & Permissions) in the
SLACK_BOT_TOKEN
environment variable - Store the values from Basic Information/App Credentials in
SLACK_CLIENT_ID
,SLACK_CLIENT_SECRET
- Store empty values in
SLACK_BOT_SCOPE
andSLACK_REDIRECT_HOST
- Launch the server with all the environment variables set
- Enable Events in Event Subscriptions using
http[s]://YOUR_DOMAIN_OR_IP/push
- Subscribe to bot events
message.im
ormessage.channels
in Event Subscriptions (Watch for the Save Changes banner on the bottom of your screen, its easy to miss. Until you click Save Changes you will not receive events).
You should be able to DM the bot now and it will repeat whatever you say back. Be sure to "save" on some pages (like OAuth & Permissions)