# sniperrus/hll-top-killer-of-the-day architecture

> Architecture diagram of the GitHub repository sniperrus/hll-top-killer-of-the-day, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sniperrus/hll-top-killer-of-the-day
- Repository: https://github.com/sniperrus/hll-top-killer-of-the-day

## Overview

This is a small Discord bot that polls the HLL CRCON API, accumulates each player’s highest observed kill count, ranks the top 20, and posts or edits a Discord embed every 15 seconds. The main function coordinates fetching, state updates, ranking, and delivery; the ready handler starts the polling loop. The single sampled source file shows these runtime relationships directly. The README documents the v9 limitation and channel-update capability; no separate implementation modules are present.

Main entry points: [`main.mjs`](https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs) (Bot Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Player Collection"]
  node_fetch["Player Fetcher<br/>[main.mjs]"]
end

subgraph group_ranking["Kill Ranking"]
  node_state[("Kill History<br/>[main.mjs]")]
  node_rank["Top 20 Ranking<br/>[main.mjs]"]
end

subgraph group_delivery["Discord Delivery"]
  node_bot["Bot Runtime<br/>[main.mjs]"]
  node_publish["Embed Publisher<br/>[main.mjs]"]
end

node_crcon{{"HLL CRCON API"}}
node_discord{{"Discord"}}

node_bot -->|"calls"| node_fetch
node_fetch -->|"fetches players"| node_crcon
node_bot -->|"updates"| node_state
node_bot -->|"requests ranking"| node_rank
node_rank -->|"reads"| node_state
node_bot -->|"publishes results"| node_publish
node_publish -->|"sends or edits"| node_discord
node_bot -->|"logs in"| node_discord

click node_bot "https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs"
click node_fetch "https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs"
click node_state "https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs"
click node_rank "https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs"
click node_publish "https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fetch toneBlue
class node_state,node_rank toneAmber
class node_bot,node_publish,node_crcon toneMint
class node_discord toneIndigo
```

## Components

### Player Collection

- [Player Fetcher](https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs): `main.mjs`

### Kill Ranking

- [Kill History](https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs): `main.mjs`
- [Top 20 Ranking](https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs): `main.mjs`

### Discord Delivery

- [Bot Runtime](https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs): `main.mjs`
- [Embed Publisher](https://github.com/sniperrus/hll-top-killer-of-the-day/blob/main/main.mjs): `main.mjs`

### Other components

- **HLL CRCON API**
- **Discord**

## Connections

- Bot Runtime → Player Fetcher: calls (evidence: `main.mjs`)
- Player Fetcher → HLL CRCON API: fetches players (evidence: `main.mjs`)
- Bot Runtime → Kill History: updates (evidence: `main.mjs`)
- Bot Runtime → Top 20 Ranking: requests ranking (evidence: `main.mjs`)
- Top 20 Ranking → Kill History: reads (evidence: `main.mjs`)
- Bot Runtime → Embed Publisher: publishes results (evidence: `main.mjs`)
- Embed Publisher → Discord: sends or edits (evidence: `main.mjs`)
- Bot Runtime → Discord: logs in (evidence: `main.mjs`)
