Skip to content

Repository files navigation

league-tracker-rust

A Discord bot that tracks League of Legends ranked solo/duo games for configured summoners and posts match summaries to a Discord webhook.

Features

  • Polls the Riot API on a configurable interval
  • Tracks ranked solo/duo matches only
  • Skips remakes and incomplete games
  • Posts kill/death timelines and multi-kill highlights to Discord
  • Deduplicates matches via SQLite so the same game is never posted twice

Requirements

  • Riot API key
  • Discord webhook URL
  • Docker (for production)
  • Rust (for local development)

Configuration

Environment Variables

Variable Description Default
API_KEY Riot Games API key required
DISCORD_WEBHOOK_URL Discord webhook URL required
DB_PATH Path to SQLite database file required
SUMMONERS_PATH Path to summoners JSON file data/summoners.json
POLL_INTERVAL_SECONDS How often to scan in seconds 60

Create a .env file in the project root:

API_KEY=<your-riot-api-key>
POLL_INTERVAL_SECONDS=<number-of-seconds-to-wait-between-polls>
DISCORD_WEBHOOK_URL=<your-discord-webhook-url>
DB_PATH=<your-database-file-path>
SUMMONERS_PATH=<your-summoners-file-path>

Summoners

Create data/summoners.json:

{
  "summoners": [
    {
      "name": "SummonerName",
      "puuid": "your-puuid-here",
      "platform": "EUW1"
    }
  ]
}

Valid platform values: NA1, EUW1, EUN1, KR, BR1, JP1, LA1, LA2, OC1, TR1, RU

To find a summoner's PUUID you can use the Riot API directly:

GET https://europe.api.riotgames.com/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}

Local Development

# Clone the repository
git clone https://github.com/agonyz/league-tracker-rust
cd league-tracker-rust

# Copy and fill in environment variables
cp .env.example .env

# Create summoners file
cp data/summoners.example.json data/summoners.json

# Run
cargo run

Run with Docker Compose

docker compose up -d

Build manually

docker build \
  --build-arg USER_ID=$(id -u) \
  --build-arg GROUP_ID=$(id -g) \
  -t league-tracker-rust .

docker run --env-file .env -v ./data:/data league-tracker-rust

Example Discord Message

Example Discord Message

About

A bot that tracks League of Legends ranked solo/duo games and posts match summaries to a Discord webhook.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages