# furina-star/league-of-legends-analyst-discord-bot architecture

> Architecture diagram of the GitHub repository furina-star/league-of-legends-analyst-discord-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/furina-star/league-of-legends-analyst-discord-bot
- Repository: https://github.com/furina-star/league-of-legends-analyst-discord-bot

## Overview

Furina is a Discord League of Legends analyst. Users invoke slash commands; draft commands fetch live match and player data, run prediction or scouting, and return Discord responses, while postgame commands analyze completed matches. Account linking and leaderboard tracking use persistent state. The README also documents localization, interactive draft coaching, and help/verdict features. The graph reflects documented capabilities and sampled implementation; some command and startup wiring is unsampled, so uncertain call links are omitted.

Main entry points: [`cogs/stats_commands.py`](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/stats_commands.py) (Stats commands), [`cogs/draft_commands.py`](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/draft_commands.py) (Draft commands), [`discord_bot.py`](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/discord_bot.py) (Bot startup), [`modules/utils/database_manager.py`](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/database_manager.py) (Account and stats store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discord["Discord experience"]
  node_draft_commands["Draft commands<br/>[draft_commands.py]"]
  node_stats_commands["Stats commands<br/>[stats_commands.py]"]
  node_general_commands["General commands"]
  node_leaderboard_commands["Leaderboard commands"]
  node_live_tracker["Live tracker<br/>[live_tracker.py]"]
  node_draft_ui["Draft interface<br/>[views.py]"]
  node_discord_bot["Bot startup<br/>[discord_bot.py]"]
end

subgraph group_analysis["Match analysis"]
  node_riot_client["Riot API client<br/>[riot_api.py]"]
  node_prediction["Draft prediction<br/>[ai_wrapper.py]"]
  node_parsers["Match parsing<br/>[parsers.py]"]
  node_postgame["Postgame verdicts<br/>[roasts.py]"]
end

subgraph group_shared["Shared services"]
  node_embeds["Response formatting<br/>[embed_formatter.py]"]
  node_canvas["Draft rendering<br/>[canvas_engine.py]"]
  node_translator["Localization<br/>[translator.py]"]
  node_db_manager["Account and stats store"]
  node_riot_cache[("Riot response cache<br/>[cache.py]")]
end

subgraph group_data["Data and integrations"]
  node_model_assets["Prediction assets"]
  node_static_data["Game reference data"]
  node_locale_data["Locale files<br/>[de.json]"]
  node_state_store[("Bot state database")]
end

node_user(("Discord user"))
node_discord_platform(("Discord platform"))
node_riot(("Riot Games API"))
node_ddragon(("Data Dragon"))

node_user -->|"invokes commands"| node_discord_platform
node_discord_platform -->|"dispatches events"| node_discord_bot
node_discord_bot -->|"loads cog"| node_draft_commands
node_discord_bot -->|"loads cog"| node_stats_commands
node_discord_bot -->|"loads cog"| node_general_commands
node_discord_bot -->|"loads cog"| node_leaderboard_commands
node_discord_bot -->|"loads cog"| node_live_tracker
node_draft_commands -->|"fetches match data"| node_riot_client
node_draft_commands -->|"requests prediction"| node_prediction
node_draft_commands -->|"builds responses"| node_embeds
node_draft_commands -->|"opens coaching UI"| node_draft_ui
node_draft_ui -->|"requests draft advice"| node_prediction
node_draft_ui -->|"renders draft board"| node_canvas
node_draft_commands -->|"sends results"| node_discord_platform
node_stats_commands -->|"fetches match data"| node_riot_client
node_stats_commands -->|"extracts stats"| node_parsers
node_stats_commands -->|"generates verdicts"| node_postgame
node_stats_commands -->|"builds report"| node_embeds
node_stats_commands -->|"records stats"| node_db_manager
node_general_commands -->|"manages linked accounts"| node_db_manager
node_general_commands -->|"accesses stats cog"| node_stats_commands
node_leaderboard_commands -->|"reads rankings"| node_db_manager
node_live_tracker -->|"tracks matches"| node_riot_client
node_live_tracker -->|"updates tracking data"| node_db_manager
node_riot_client -->|"reads and writes cache"| node_riot_cache
node_riot_client -->|"requests player and match data"| node_riot
node_prediction -->|"loads model"| node_model_assets
node_prediction -->|"uses meta data"| node_static_data
node_prediction -.->|"uses queued training data"| node_db_manager
node_db_manager -->|"reads and writes state"| node_state_store
node_canvas -->|"fetches champion art"| node_ddragon
node_translator -->|"loads translations"| node_locale_data

click node_draft_commands "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/draft_commands.py"
click node_stats_commands "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/stats_commands.py"
click node_general_commands "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/general_commands.py"
click node_leaderboard_commands "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/leaderboard_commands.py"
click node_live_tracker "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/live_tracker.py"
click node_draft_ui "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/interface/views.py"
click node_discord_bot "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/discord_bot.py"
click node_riot_client "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/services/riot_api.py"
click node_prediction "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/services/ai_wrapper.py"
click node_parsers "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/parsers.py"
click node_postgame "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/persona/roasts.py"
click node_embeds "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/interface/embed_formatter.py"
click node_canvas "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/interface/canvas_engine.py"
click node_translator "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/translator.py"
click node_db_manager "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/database_manager.py"
click node_riot_cache "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/cache.py"
click node_model_assets "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/data/models/Lol_draft_predictor.safetensors"
click node_static_data "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/data/static/Meta_Champions.json"
click node_locale_data "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/data/locale/de.json"
click node_state_store "https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/database_manager.py"

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_draft_commands,node_stats_commands,node_general_commands,node_leaderboard_commands,node_live_tracker,node_draft_ui,node_discord_bot,node_user toneBlue
class node_riot_client,node_prediction,node_parsers,node_postgame toneAmber
class node_embeds,node_canvas,node_translator,node_db_manager,node_riot_cache,node_riot toneMint
class node_model_assets,node_static_data,node_locale_data,node_state_store toneRose
class node_discord_platform,node_ddragon toneIndigo
```

## Components

### Discord experience

- [Draft commands](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/draft_commands.py): `cogs/draft_commands.py`
- [Stats commands](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/stats_commands.py): `cogs/stats_commands.py`
- [General commands](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/general_commands.py): `cogs/general_commands.py`
- [Leaderboard commands](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/leaderboard_commands.py): `cogs/leaderboard_commands.py`
- [Live tracker](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/cogs/live_tracker.py): `cogs/live_tracker.py`
- [Draft interface](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/interface/views.py): `modules/interface/views.py`
- [Bot startup](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/discord_bot.py): `discord_bot.py`

### Match analysis

- [Riot API client](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/services/riot_api.py): `services/riot_api.py`
- [Draft prediction](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/services/ai_wrapper.py): `services/ai_wrapper.py`
- [Match parsing](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/parsers.py): `modules/utils/parsers.py`
- [Postgame verdicts](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/persona/roasts.py): `modules/persona/roasts.py`

### Shared services

- [Response formatting](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/interface/embed_formatter.py): `modules/interface/embed_formatter.py`
- [Draft rendering](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/interface/canvas_engine.py): `modules/interface/canvas_engine.py`
- [Localization](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/translator.py): `modules/utils/translator.py`
- [Account and stats store](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/database_manager.py): `modules/utils/database_manager.py`
- [Riot response cache](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/cache.py): `modules/utils/cache.py`

### Data and integrations

- [Prediction assets](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/data/models/Lol_draft_predictor.safetensors): `data/models/Lol_draft_predictor.safetensors`
- [Game reference data](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/data/static/Meta_Champions.json): `data/static/Meta_Champions.json`
- [Locale files](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/data/locale/de.json): `data/locale/de.json`
- [Bot state database](https://github.com/furina-star/league-of-legends-analyst-discord-bot/blob/main/modules/utils/database_manager.py): `modules/utils/database_manager.py`

### Other components

- **Discord user**
- **Discord platform**
- **Riot Games API**
- **Data Dragon**

## Connections

- Discord user → Discord platform: invokes commands
- Discord platform → Bot startup: dispatches events
- Bot startup → Draft commands: loads cog
- Bot startup → Stats commands: loads cog
- Bot startup → General commands: loads cog
- Bot startup → Leaderboard commands: loads cog
- Bot startup → Live tracker: loads cog
- Draft commands → Riot API client: fetches match data
- Draft commands → Draft prediction: requests prediction
- Draft commands → Response formatting: builds responses
- Draft commands → Draft interface: opens coaching UI
- Draft interface → Draft prediction: requests draft advice
- Draft interface → Draft rendering: renders draft board
- Draft commands → Discord platform: sends results
- Stats commands → Riot API client: fetches match data
- Stats commands → Match parsing: extracts stats
- Stats commands → Postgame verdicts: generates verdicts
- Stats commands → Response formatting: builds report
- Stats commands → Account and stats store: records stats
- General commands → Account and stats store: manages linked accounts
- General commands → Stats commands: accesses stats cog
- Leaderboard commands → Account and stats store: reads rankings
- Live tracker → Riot API client: tracks matches
- Live tracker → Account and stats store: updates tracking data
- Riot API client → Riot response cache: reads and writes cache
- Riot API client → Riot Games API: requests player and match data
- Draft prediction → Prediction assets: loads model
- Draft prediction → Game reference data: uses meta data
- Draft prediction → Account and stats store: uses queued training data
- Account and stats store → Bot state database: reads and writes state
- Draft rendering → Data Dragon: fetches champion art
- Localization → Locale files: loads translations
