# paulmndn/vrmlbot architecture

> Architecture diagram of the GitHub repository paulmndn/vrmlbot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paulmndn/vrmlbot
- Repository: https://github.com/paulmndn/vrmlbot

## Overview

VRMLbot is a Discord bot that turns VR Master League data into command responses, with server defaults and administrator messaging as supporting workflows. Discord users invoke the bot; its handlers use the VRML client to search or fetch game, player, and team data and present results. The client models seasons, bios, news, matches, and sets, backed by an HTTP layer. Guild settings and a scheduled player cache support server behavior. The graph follows documented capabilities and indexed imports; unsampled bot handlers and several VRML modules limit more specific call-flow claims.

Main entry points: [`vrml/game.py`](https://github.com/paulmndn/vrmlbot/blob/main/vrml/game.py) (Games), [`vrml/player.py`](https://github.com/paulmndn/vrmlbot/blob/main/vrml/player.py) (Players), [`vrml/team.py`](https://github.com/paulmndn/vrmlbot/blob/main/vrml/team.py) (Teams), [`vrml/http.py`](https://github.com/paulmndn/vrmlbot/blob/main/vrml/http.py) (HTTP API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discord["Discord Bot"]
  node_bot["Command handlers<br/>[bot.py]"]
end

subgraph group_operations["Bot Operations"]
  node_config["Bot configuration<br/>[config.py]"]
  node_admin["Admin actions<br/>[admin_actions.py]"]
  node_guild[("Guild settings<br/>[guild.py]")]
  node_cache["Player cache<br/>[player_cache.py]"]
  node_tasks["Scheduled tasks<br/>[tasks.py]"]
end

subgraph group_client["VRML Client"]
  node_vrml_facade["VRML client API<br/>[__init__.py]"]
  node_http["HTTP API client<br/>[http.py]"]
  node_vrml_utils["VRML utilities<br/>[utils.py]"]
end

subgraph group_domain["VRML Data Models"]
  node_game["Games<br/>[game.py]"]
  node_player["Players<br/>[player.py]"]
  node_team["Teams<br/>[team.py]"]
  node_match["Matches<br/>[match.py]"]
  node_season["Seasons<br/>[season.py]"]
  node_bio["Player bios<br/>[bio.py]"]
  node_user["VRML users<br/>[user.py]"]
  node_news["Game news<br/>[newspost.py]"]
  node_set["Match sets<br/>[set.py]"]
end

node_discord_user(("Discord user"))
node_guild_members(("Discord guilds"))
node_vrml_api{{"VRML API"}}

node_discord_user -->|"invokes commands"| node_bot
node_bot -->|"uses client"| node_vrml_facade
node_bot -.->|"uses settings"| node_guild
node_bot -->|"offers admin commands"| node_admin
node_admin -->|"messages guilds"| node_guild
node_admin -->|"starts tasks"| node_tasks
node_tasks -->|"fetches player data"| node_vrml_facade
node_tasks -.->|"updates cache"| node_cache
node_guild_members -->|"has settings"| node_guild
node_guild -->|"sends messages"| node_guild_members
node_vrml_facade -->|"requests data"| node_http
node_http -->|"sends requests"| node_vrml_api
node_vrml_facade -->|"constructs games"| node_game
node_game -->|"fetches game data"| node_http
node_game -->|"builds season"| node_season
node_game -->|"builds news posts"| node_news
node_game -->|"searches teams"| node_team
node_vrml_facade -->|"constructs players"| node_player
node_player -->|"fetches details"| node_http
node_player -->|"builds user"| node_user
node_player -->|"builds bios"| node_bio
node_player -->|"builds game reference"| node_game
node_team -->|"fetches team"| node_http
node_team -->|"builds seasons"| node_season
node_team -->|"builds roster"| node_player
node_team -->|"builds matches"| node_match
node_match -->|"fetches sets"| node_http
node_match -->|"builds partial teams"| node_team
node_match -->|"builds sets"| node_set
node_news -->|"builds author"| node_user
node_news -->|"links game"| node_game
node_game -->|"uses game helpers"| node_vrml_utils
node_team -->|"uses display helpers"| node_vrml_utils
node_player -->|"uses display helpers"| node_vrml_utils
node_bio -->|"uses season data"| node_season

click node_bot "https://github.com/paulmndn/vrmlbot/blob/main/bot.py"
click node_config "https://github.com/paulmndn/vrmlbot/blob/main/lib/config.py"
click node_admin "https://github.com/paulmndn/vrmlbot/blob/main/lib/admin_actions.py"
click node_guild "https://github.com/paulmndn/vrmlbot/blob/main/lib/guild.py"
click node_cache "https://github.com/paulmndn/vrmlbot/blob/main/lib/player_cache.py"
click node_tasks "https://github.com/paulmndn/vrmlbot/blob/main/lib/tasks.py"
click node_vrml_facade "https://github.com/paulmndn/vrmlbot/blob/main/vrml/__init__.py"
click node_http "https://github.com/paulmndn/vrmlbot/blob/main/vrml/http.py"
click node_game "https://github.com/paulmndn/vrmlbot/blob/main/vrml/game.py"
click node_player "https://github.com/paulmndn/vrmlbot/blob/main/vrml/player.py"
click node_team "https://github.com/paulmndn/vrmlbot/blob/main/vrml/team.py"
click node_match "https://github.com/paulmndn/vrmlbot/blob/main/vrml/match.py"
click node_season "https://github.com/paulmndn/vrmlbot/blob/main/vrml/season.py"
click node_bio "https://github.com/paulmndn/vrmlbot/blob/main/vrml/bio.py"
click node_user "https://github.com/paulmndn/vrmlbot/blob/main/vrml/user.py"
click node_news "https://github.com/paulmndn/vrmlbot/blob/main/vrml/newspost.py"
click node_set "https://github.com/paulmndn/vrmlbot/blob/main/vrml/set.py"
click node_vrml_utils "https://github.com/paulmndn/vrmlbot/blob/main/vrml/utils.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_bot,node_discord_user toneBlue
class node_config,node_admin,node_guild,node_cache,node_tasks toneAmber
class node_vrml_facade,node_http,node_vrml_utils,node_vrml_api toneMint
class node_game,node_player,node_team,node_match,node_season,node_bio,node_user,node_news,node_set toneRose
class node_guild_members toneIndigo
```

## Components

### Discord Bot

- [Command handlers](https://github.com/paulmndn/vrmlbot/blob/main/bot.py): `bot.py`

### Bot Operations

- [Bot configuration](https://github.com/paulmndn/vrmlbot/blob/main/lib/config.py): `lib/config.py`
- [Admin actions](https://github.com/paulmndn/vrmlbot/blob/main/lib/admin_actions.py): `lib/admin_actions.py`
- [Guild settings](https://github.com/paulmndn/vrmlbot/blob/main/lib/guild.py): `lib/guild.py`
- [Player cache](https://github.com/paulmndn/vrmlbot/blob/main/lib/player_cache.py): `lib/player_cache.py`
- [Scheduled tasks](https://github.com/paulmndn/vrmlbot/blob/main/lib/tasks.py): `lib/tasks.py`

### VRML Client

- [VRML client API](https://github.com/paulmndn/vrmlbot/blob/main/vrml/__init__.py): `vrml/__init__.py`
- [HTTP API client](https://github.com/paulmndn/vrmlbot/blob/main/vrml/http.py): `vrml/http.py`
- [VRML utilities](https://github.com/paulmndn/vrmlbot/blob/main/vrml/utils.py): `vrml/utils.py`

### VRML Data Models

- [Games](https://github.com/paulmndn/vrmlbot/blob/main/vrml/game.py): `vrml/game.py`
- [Players](https://github.com/paulmndn/vrmlbot/blob/main/vrml/player.py): `vrml/player.py`
- [Teams](https://github.com/paulmndn/vrmlbot/blob/main/vrml/team.py): `vrml/team.py`
- [Matches](https://github.com/paulmndn/vrmlbot/blob/main/vrml/match.py): `vrml/match.py`
- [Seasons](https://github.com/paulmndn/vrmlbot/blob/main/vrml/season.py): `vrml/season.py`
- [Player bios](https://github.com/paulmndn/vrmlbot/blob/main/vrml/bio.py): `vrml/bio.py`
- [VRML users](https://github.com/paulmndn/vrmlbot/blob/main/vrml/user.py): `vrml/user.py`
- [Game news](https://github.com/paulmndn/vrmlbot/blob/main/vrml/newspost.py): `vrml/newspost.py`
- [Match sets](https://github.com/paulmndn/vrmlbot/blob/main/vrml/set.py): `vrml/set.py`

### Other components

- **Discord user**
- **Discord guilds**
- **VRML API**

## Connections

- Discord user → Command handlers: invokes commands (evidence: `README.md`)
- Command handlers → VRML client API: uses client (evidence: `bot.py`)
- Command handlers → Guild settings: uses settings
- Command handlers → Admin actions: offers admin commands (evidence: `README.md`)
- Admin actions → Guild settings: messages guilds (evidence: `lib/admin_actions.py`)
- Admin actions → Scheduled tasks: starts tasks (evidence: `lib/admin_actions.py`)
- Scheduled tasks → VRML client API: fetches player data (evidence: `lib/tasks.py`)
- Scheduled tasks → Player cache: updates cache
- Discord guilds → Guild settings: has settings (evidence: `lib/guild.py`)
- Guild settings → Discord guilds: sends messages (evidence: `lib/guild.py`)
- VRML client API → HTTP API client: requests data (evidence: `vrml/__init__.py`)
- HTTP API client → VRML API: sends requests (evidence: `vrml/http.py`)
- VRML client API → Games: constructs games (evidence: `vrml/__init__.py`)
- Games → HTTP API client: fetches game data (evidence: `vrml/game.py`)
- Games → Seasons: builds season (evidence: `vrml/game.py`)
- Games → Game news: builds news posts (evidence: `vrml/game.py`)
- Games → Teams: searches teams (evidence: `vrml/game.py`)
- VRML client API → Players: constructs players (evidence: `vrml/__init__.py`)
- Players → HTTP API client: fetches details (evidence: `vrml/player.py`)
- Players → VRML users: builds user (evidence: `vrml/player.py`)
- Players → Player bios: builds bios (evidence: `vrml/player.py`)
- Players → Games: builds game reference (evidence: `vrml/player.py`)
- Teams → HTTP API client: fetches team (evidence: `vrml/team.py`)
- Teams → Seasons: builds seasons (evidence: `vrml/team.py`)
- Teams → Players: builds roster (evidence: `vrml/team.py`)
- Teams → Matches: builds matches (evidence: `vrml/team.py`)
- Matches → HTTP API client: fetches sets (evidence: `vrml/match.py`)
- Matches → Teams: builds partial teams (evidence: `vrml/match.py`)
- Matches → Match sets: builds sets (evidence: `vrml/match.py`)
- Game news → VRML users: builds author (evidence: `vrml/newspost.py`)
- Game news → Games: links game (evidence: `vrml/newspost.py`)
- Games → VRML utilities: uses game helpers (evidence: `vrml/game.py`)
- Teams → VRML utilities: uses display helpers (evidence: `vrml/team.py`)
- Players → VRML utilities: uses display helpers (evidence: `vrml/player.py`)
- Player bios → Seasons: uses season data (evidence: `vrml/bio.py`)
