# myownhatred/bigcatbot architecture

> Architecture diagram of the GitHub repository myownhatred/bigcatbot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/myownhatred/bigcatbot
- Repository: https://github.com/myownhatred/bigcatbot

## Overview

##### Main Components

a) Core Bot Layer (bigcat/)
- Command Handlers
- Callback Processors
- Message Handlers
- Game Systems

b) Service Layer (servitor/)
- Media Services
- External API Integrations
- Configuration Management
- Moderation Services

c) Data Access Layer (bringer/)
- Data Fetchers
- Configuration Management
- Memory Services

d) Domain Entities (entities/)
- Data Models
- Generator Systems
- Time Management
- Vector Processing

e) Library Components (lib/)
- D&D Game Engine
- Citizen Management
- Vector Processing
- Memory Services
- Error Handling

**┌─────────────────────┐**
- Telegram API     │
- ┘
- ↕
**┌─────────────────────┐**
- Bot Core (bigcat) │
- ┘
- ↕
**┌─────────────────────┐**
- Services (servitor) │
- ┘
- ↕
**┌─────────────────────┐**
- Data (bringer)     │
- ┘

##### Component Relationships to Highlight

a) Core Bot Layer interactions:
- Command routing
- Callback processing
- Game state management
- Message handling

b) Service Layer interactions:
- Media processing
- External API communications
- Configuration management
- Moderation services

c) Data Layer interactions:
- Data persistence
- Memory management
- Configuration loading
- External data fetching

##### Implementation Details

Use these symbols:
- Rectangles: Major components
- Diamonds: Decision points

##### Additional Elements

Specialized sections for:
- Configuration management flow
- Memory service architecture
- Media processing pipeline
- Game state management
- Command processing pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Layer
    subgraph External
        TG[Telegram API]:::external
    end

    %% Core Bot Layer
    subgraph CoreBot
        CH["Command Handlers"]:::core
        CB["Callback Processors"]:::core
        MH["Message Handlers"]:::core
        GS["Game Systems"]:::core
    end

    %% Service Layer
    subgraph Services
        MS["Media Services"]:::service
        TI["Twitter Integration"]:::service
        MOD["Moderation Services"]:::service
        CM["Configuration Management"]:::service
    end

    %% Data Access Layer
    subgraph DataAccess
        MEM["Memory Services"]:::data
        CFG["Configuration Management"]:::data
        TDF["Twitter Data Fetching"]:::data
        TM["Time Management"]:::data
    end

    %% Domain Entities
    subgraph Entities
        GEN["Generator System"]:::entity
        TME["Time Management"]:::entity
        VP["Vector Processing"]:::entity
    end

    %% Library Components
    subgraph Libraries
        DND["D&D Game Engine"]:::library
        CIT["Citizen Management"]:::library
        VPL["Vector Processing"]:::library
        MLS["Memory Services"]:::library
        EH["Error Handling"]:::library
    end

    %% Relationships
    TG <--> CH & CB & MH
    CH & CB & MH --> GS
    GS --> MS & MOD
    CH & CB --> TI
    TI --> TDF
    MS & TI & MOD & CM --> MEM
    CM --> CFG
    GS --> DND
    DND --> CIT
    VP --> VPL
    MEM --> MLS
    TM --> TME
    
    %% Click Events
    click CH "https://github.com/myownhatred/BigCatBot/blob/main/bigcat/commands.go"
    click CB "https://github.com/myownhatred/BigCatBot/blob/main/bigcat/callbacks.go"
    click MH "https://github.com/myownhatred/BigCatBot/blob/main/bigcat/handlers.go"
    click GS "https://github.com/myownhatred/BigCatBot/tree/main/bigcat/games/"
    click MS "https://github.com/myownhatred/BigCatBot/blob/main/servitor/mediacreator.go"
    click TI "https://github.com/myownhatred/BigCatBot/blob/main/servitor/twitter.go"
    click MOD "https://github.com/myownhatred/BigCatBot/blob/main/servitor/police.go"
    click CM "https://github.com/myownhatred/BigCatBot/blob/main/servitor/comfiger.go"
    click MEM "https://github.com/myownhatred/BigCatBot/blob/main/bringer/memser.go"
    click CFG "https://github.com/myownhatred/BigCatBot/blob/main/bringer/comfiger.go"
    click TDF "https://github.com/myownhatred/BigCatBot/blob/main/bringer/twitter.go"
    click TM "https://github.com/myownhatred/BigCatBot/blob/main/bringer/timewithout.go"
    click GEN "https://github.com/myownhatred/BigCatBot/blob/main/entities/genarator.go"
    click TME "https://github.com/myownhatred/BigCatBot/blob/main/entities/timewithout.go"
    click VP "https://github.com/myownhatred/BigCatBot/blob/main/entities/vector.go"
    click DND "https://github.com/myownhatred/BigCatBot/tree/main/lib/DND/"
    click CIT "https://github.com/myownhatred/BigCatBot/tree/main/lib/citizen/"
    click VPL "https://github.com/myownhatred/BigCatBot/blob/main/lib/vector/vector.go"
    click MLS "https://github.com/myownhatred/BigCatBot/blob/main/lib/memser/memser.go"
    click EH "https://github.com/myownhatred/BigCatBot/blob/main/lib/e/e.go"

    %% Styles
    classDef external fill:#2374e1,stroke:#164b94,stroke-width:2px,color:#fff
    classDef core fill:#4caf50,stroke:#2e7d32,stroke-width:2px,color:#fff
    classDef service fill:#ffeb3b,stroke:#fbc02d,stroke-width:2px
    classDef data fill:#ff9800,stroke:#f57c00,stroke-width:2px
    classDef entity fill:#9c27b0,stroke:#7b1fa2,stroke-width:2px,color:#fff
    classDef library fill:#607d8b,stroke:#455a64,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        L1[External Services]:::external
        L2[Core Components]:::core
        L3[Service Layer]:::service
        L4[Data Access]:::data
        L5[Domain Entities]:::entity
        L6[Libraries]:::library
    end
```
