Our friendly bot-overlord notifying people when there is freshly brewed coffee in the kitchen.
Super Chemex Bot is a Slack app that posts a message in channel when an AWS IoT button is pressed.
Super Chemex Bot is only a small piece of code but requires a bit of configuration to get running. Below is a high level overview of the steps you'll have to take to get it working.
- Clone this repository
cd
into thelambda
directory and runnpm install
(yarn install
is also supported).- Set up a Contentful space.
- You'll need to create two content types
- One with the ID
configuration
and two short text fields with the IDsdeviceSerialNumber
andslackChannel
- The other with the ID
message
and a short text field with the IDmessage
- One with the ID
- Create at least one entry for each of these content types. One mapping a button serial number to a slack channel, the other with the message you want to post.
- Create an API key. You'll need it later.
- You'll need to create two content types
- Create a Slack app
- Go to the Slack app wizard. Give your app a name and select a workspace.
- Give the app the scope
chat:write:bot
- Install the app into your workspace. To do so you'll need to authenticate with oAuth. Follow Slack's tutorial for the easiest way to do it.
- Time to set up the button
- Configure your button by following the AWS tutorial
- Choose to create an AWS Lambda function that is triggered by your button
- Add three environment variables to the Lambda function:
SLACK_API_TOKEN
,CONTENTFUL_ACCESS_TOKEN
,CONTENTFUL_SPACE_ID
- Install and configure the AWS cli.
- Open
deploy.sh
and change the value after--function-name
to the name of your new Lambda function - Navigate to the project root folder and run
./deploy.sh
- All done!
Copyright (c) 2017 Contentful GmbH. Code released under the MIT license. See [LICENSE][LICENSE] for further details.