# nonamespecified/unbelievaboat-python-bot architecture

> Architecture diagram of the GitHub repository nonamespecified/unbelievaboat-python-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nonamespecified/unbelievaboat-python-bot
- Repository: https://github.com/nonamespecified/unbelievaboat-python-bot

## Overview

Skender is a customizable Discord economy bot. Discord messages enter through the bot startup/event handlers, are interpreted by SkenderBot, and are handled with command context, utilities, and the database backend; game commands also use the blackjack and roulette implementations. The README highlights economy commands and automated role income; the source describes leveling, inventory/items, setup, and SQLite migration. Those capabilities are represented at subsystem level. Some internals are unsampled, so the graph omits unverified command-to-storage details.

Main entry points: [`src/bot.py`](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/bot.py) (Command handling), [`src/database/__init__.py`](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py) (Database handler), [`src/main.py`](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/main.py) (Startup and events), [`src/database/database_migration.py`](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/database_migration.py) (JSON migration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_entry["Startup and events<br/>[main.py]"]
  node_bot["Command handling<br/>[bot.py]"]
  node_context["Command context<br/>[context.py]"]
  node_utilities["Bot utilities<br/>[utilities.py]"]
end

subgraph group_features["Economy features"]
  node_economy["Economy and balances<br/>[__init__.py]"]
  node_items["Items and inventory<br/>[__init__.py]"]
  node_role_income["Role income<br/>[__init__.py]"]
  node_levels["Levels and rewards<br/>[__init__.py]"]
  node_blackjack["Blackjack<br/>[blackjack.py]"]
  node_roulette["Roulette<br/>[roulette.py]"]
end

subgraph group_persistence["Persistence"]
  node_database["Database handler<br/>[__init__.py]"]
  node_sqlite[("SQLite database<br/>[__init__.py]")]
  node_migration["JSON migration"]
end

node_discord_users(("Discord users"))
node_discord_api["Discord API"]

node_discord_users -->|"send messages"| node_discord_api
node_discord_api -->|"deliver events"| node_entry
node_entry -->|"dispatch events"| node_bot
node_entry -->|"configure client"| node_discord_api
node_bot -->|"builds context"| node_context
node_bot -->|"uses utilities"| node_utilities
node_bot -->|"delegates commands"| node_database
node_database -->|"reads and writes"| node_sqlite
node_database -->|"uses game"| node_blackjack
node_database -->|"uses game"| node_roulette
node_migration -->|"creates target"| node_database
node_bot -.->|"handles commands"| node_economy
node_bot -.->|"handles commands"| node_items
node_bot -.->|"handles commands"| node_role_income
node_bot -.->|"handles commands"| node_levels

click node_entry "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/main.py"
click node_bot "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/bot.py"
click node_context "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/context.py"
click node_utilities "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/utilities.py"
click node_economy "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py"
click node_items "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py"
click node_role_income "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py"
click node_levels "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py"
click node_blackjack "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/game_libs/blackjack.py"
click node_roulette "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/game_libs/roulette.py"
click node_database "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py"
click node_sqlite "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py"
click node_migration "https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/database_migration.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_entry,node_bot,node_context,node_utilities,node_discord_users toneBlue
class node_economy,node_items,node_role_income,node_levels,node_blackjack,node_roulette toneAmber
class node_database,node_sqlite,node_migration,node_discord_api toneMint
```

## Components

### Bot runtime

- [Startup and events](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/main.py): `src/main.py`
- [Command handling](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/bot.py): `src/bot.py`
- [Command context](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/context.py): `src/context.py`
- [Bot utilities](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/utilities.py): `src/utilities.py`

### Economy features

- [Economy and balances](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py): `src/database/__init__.py`
- [Items and inventory](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py): `src/database/__init__.py`
- [Role income](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py): `src/database/__init__.py`
- [Levels and rewards](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py): `src/database/__init__.py`
- [Blackjack](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/game_libs/blackjack.py): `src/game_libs/blackjack.py`
- [Roulette](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/game_libs/roulette.py): `src/game_libs/roulette.py`

### Persistence

- [Database handler](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py): `src/database/__init__.py`
- [SQLite database](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/__init__.py): `src/database/__init__.py`
- [JSON migration](https://github.com/nonamespecified/unbelievaboat-python-bot/blob/main/src/database/database_migration.py): `src/database/database_migration.py`

### Other components

- **Discord users**
- **Discord API**

## Connections

- Discord users → Discord API: send messages (evidence: `README.md`)
- Discord API → Startup and events: deliver events (evidence: `src/main.py`)
- Startup and events → Command handling: dispatch events (evidence: `src/main.py`)
- Startup and events → Discord API: configure client (evidence: `src/main.py`)
- Command handling → Command context: builds context (evidence: `src/bot.py`)
- Command handling → Bot utilities: uses utilities (evidence: `src/bot.py`)
- Command handling → Database handler: delegates commands (evidence: `src/bot.py`)
- Database handler → SQLite database: reads and writes (evidence: `src/database/__init__.py`)
- Database handler → Blackjack: uses game (evidence: `src/database/__init__.py`)
- Database handler → Roulette: uses game (evidence: `src/database/__init__.py`)
- JSON migration → Database handler: creates target (evidence: `src/database/database_migration.py`)
- Command handling → Economy and balances: handles commands (evidence: `src/bot.py`)
- Command handling → Items and inventory: handles commands (evidence: `src/bot.py`)
- Command handling → Role income: handles commands (evidence: `src/bot.py`)
- Command handling → Levels and rewards: handles commands (evidence: `src/bot.py`)
