Skip to content

A discord webhook for a private Advent of Code leaderboard

Notifications You must be signed in to change notification settings

jakobkordez/aoc-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code Discord Webhook

Sends an image of an Advent of Code private leaderboard to a Discord server once a day.

Originally by Martin Hanzlowsky

Updated by Matic Babnik

Enviromental variables

Supports .env files.

WEBHOOK_URL=...
LEADERBOARD_ID=...
SESSION_ID=...

Setup

Simple

# Install dependencies
yarn

# Build
yarn build

# Start
yarn start

To override the CronJob and instantly send the leaderboard, use the --now flag.

yarn start --now

Docker

# Build image
docker build -t aoc-webhook .

# Run
docker run -d --name aoc-webhook aoc-webhook

Development / Debugging

To run the bot on a specific date, set the date variable in index.ts.

async function main() {
    const date = new Date(Date.UTC(2023, 11, 25));
    ...
}