A Slack bot that joins the conversation with emojis.
Create an AWS account if haven't got one already
Deploy the server to AWS Lambda:
npm install
serverless deploy
npm install
serverless deploy
Note that you'll be charged for these services until they are removed.
Make a note of the endpoints output once it has deployed, e.g.:
endpoints:
POST - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/event
POST - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/explain
endpoints:
POST - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/event
POST - https://ab12cd34ef.execute-api.eu-west-1.amazonaws.com/dev/explain
Update the Slack app manifest for your server:
manifest.yml
<event endpoint>
with the event
endpoint<explain endpoint>
with the explain
endpointCreate your Slack app from the manifest:
Install the Slack app to your workspace:
resources/emojibot.png
Configure the server credentials:
Create a .env
file (do not commit this file, it is already Git ignored):
# Environment variables -- DO NOT COMMIT!
BOT_ACCESS_TOKEN = <bot access token>
# Environment variables -- DO NOT COMMIT!
BOT_ACCESS_TOKEN = <bot access token>
Replace <bot access token>
with your copied bot user OAuth token
Save the file
Redeploy the server to update the environment variable:
serverless deploy
serverless deploy
The bot works by using a map of words to emojis. This map is derived from emoji-data and emojilib and stored in emoji.js. To regenerate it:
npm run generate
npm run generate
To run the unit tests:
npm test
npm test
To undeploy the server from AWS:
serverless remove
serverless remove