A quick and dirty slack webhook bot that announces when members of a private leaderboard achieve a star!
The script utilises .env
files for config, rename .env.example
to .env
and populate, to add a production stage copy the .env
file to .env.production
.
LEADERBOARD_ID
Your private leaderboard ID, this can be found on the AoC Leaderboard Page.
LEADERBOARD_SESSION
This is your Session token from the AOC website, see the AoC documentation.
SLACK_WEBHOOK
The slack webhook URL to post to
INTERVAL_HOURS
The number of hours between each interval (default: 1)
To set up team members copy team_members_example.py
to team_members.py
Assuming you have your AWS credentials configured correctly run:
serverless deploy --stage={dev|prod}
You can invoke the function locally by running:
serverless invoke local
By default the function runs hourly and it currently doesn't check it's last run time so it naively deducts an hour from the current timestamp to filter out which stars to notify about.
My private leaderboard is using the STARS ordering method, therefore we don't really care about points, this bot reflects that.