A slack event bot built with serverless/typescript/webpack using AWS Lambda & API Gateway, that will recieve slack events and respond to them in various ways
- AWS Account
- Slack Account
- run
yarn install
to install dependencies - Install a slack app to the workplace
- On the app, go to the
Basic Information
page and get the Verification Token setting this asSLACK_SIGNING_TOKEN
in your.env
file - run
SLACK_SIGNING_TOKEN=123 sls deploy
to deploy the app - Add a slack app and click on
Event Subscriptions
- You will be asked to enter a URL, enter the URL output the from Serverless deploy step
- This will respond to the verification challenge, and turn verified
- If you have issues, check the aws cloudfront logs for the slack bot lambda
- In the
Subscribe to events on behalf of users
section add the following- member_joined_channel
- team_join
- Go to the
OAuth Tokens & Redirect URLs
page and in theUser Token Scopes
section and check the following is enabled- channels:read
- groups:read
- users:read
- Go to them
Install App
page and click to add the app to your workspace. You will be asked to grant permissions. - Search for an app called
bots
in the slack app directory- Click Add to slack
- Add a suitable bot name and image, This will be shown with the message.
- get the API Token and set as
SLACK_TOKEN
in your.env
file
- Run
SLACK_SIGNING_TOKEN=123 SLACK_TOKEN-abc sls deploy
to deploy the application complete with slack tokens - Create a new user and join
General
and see an epehemeral message in action.
Hi member, welcome to the Pact Foundation community!
Please join the relevant channels for your Pact implementation, so you can discuss your issues with the audience who can best help you.
If you need help with an issue please check your DM from the welcome bot for more info.
- Join a new channel and see an ephemeral message in action.
Hi member, Thanks for joining a new Pact Foundation channel. Feel free to ask questions
See https://app.slack.com/app-settings/T5F60FXSQ/A017BFQ1XPB/app-manifest