Awesome
WorldCup Bot
Meet WorldCup Bot, a dirty simple bot for posting 2018 FIFA World Cup Russia™ matches events to Slack.
WorldCup Bot will post:
- Today's matches
- Matches about to start
- Goals
- Yellow and red cards
Getting started
Configure your AWS keys, this article shows various ways of configuring the keys. A quick simple one is just to export AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
. Personally, I prefer aws-vault for managing my keys.
Get a Slack Token.
Create an .env
file as follows:
SLACK_TOKEN=YOUR-SLACK-TOKEN
SLACK_CHANNEL=#worldcup
SLACK_BOT_NAME=WorldCup Bot
Install dependencies:
# See https://yarnpkg.com/lang/en/docs/install/
yarn install
Deploy:
yarn deploy
That's it, the WorldCup Bot will check and notify matches events every 1 minute. For changing the frequency or disabling the auto notification, check the CloudWatch Event configuration.
Invoking from command-line
For invoking the deployed version:
yarn sls invoke -f matches
For invoking the local version:
yarn sls invoke local -f matches
AWS Resources
WorldCup Bot runs on AWS and it uses:
- CloudFormation provisioned with Serverless
- Lambda for processing matches data from WORLD CUP 2018 and posting to Slack
- CloudWatch Events for triggering the Lambda every 1 minute
- DynamoDB for keeping track of the sent messages to avoid duplicates
Uninstall
Once you are done with your bot, you can just remove the CloudFormation stack yarn sls remove
.