# granit1004/bot-loterry architecture

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

- Interactive diagram: https://gitdiagram.com/granit1004/bot-loterry
- Repository: https://github.com/granit1004/bot-loterry

## Overview

This is a Telegram lottery bot: users browse and enter free or paid raffles, while administrators create raffles and draw winners. The README also describes a button-based interface, an admin panel, and privacy options. The sampled code is a single monolithic module; its excerpts show raffle participation, winner selection, notifications, and persistence calls, but not the full payment flow or privacy implementation. Accordingly, those documented capabilities are represented without guessing their internal wiring.

Main entry points: [`Bot_Antihrist1/bot.py`](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py) (Winner selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Bot interaction"]
  node_bot_ui["Button interface<br/>[bot.py]"]
  node_privacy["Privacy options<br/>[bot.py]"]
end

subgraph group_raffles["Lottery operations"]
  node_raffle_browse["Browse raffles<br/>[bot.py]"]
  node_raffle_entry["Raffle entry<br/>[bot.py]"]
  node_paid_entry["Paid entry<br/>[bot.py]"]
  node_winner_draw["Winner selection<br/>[bot.py]"]
end

subgraph group_administration["Administration"]
  node_raffle_admin["Raffle management<br/>[bot.py]"]
  node_channel_admin["Channel management<br/>[bot.py]"]
end

subgraph group_state["Bot state"]
  node_raffle_state["Raffle state<br/>[bot.py]"]
end

node_users(("Telegram users"))
node_telegram["Telegram platform"]

node_users -->|"use buttons"| node_bot_ui
node_users -.->|"enter raffle"| node_raffle_entry
node_users -.->|"pay to enter"| node_paid_entry
node_users -.->|"set options"| node_privacy
node_raffle_entry -->|"save participants"| node_raffle_state
node_winner_draw -->|"read participants"| node_raffle_state
node_winner_draw -->|"notify winners"| node_telegram
node_winner_draw -->|"refresh details"| node_raffle_browse
node_users -.->|"administer"| node_raffle_admin
node_raffle_admin -->|"save raffle"| node_raffle_state
node_channel_admin -->|"broadcast"| node_telegram

click node_bot_ui "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_privacy "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_raffle_browse "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_raffle_entry "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_paid_entry "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_winner_draw "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_raffle_admin "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_channel_admin "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py"
click node_raffle_state "https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.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_ui,node_privacy,node_users toneBlue
class node_raffle_browse,node_raffle_entry,node_paid_entry,node_winner_draw toneAmber
class node_raffle_admin,node_channel_admin toneMint
class node_raffle_state toneRose
class node_telegram toneIndigo
```

## Components

### Bot interaction

- [Button interface](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`
- [Privacy options](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`

### Lottery operations

- [Browse raffles](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`
- [Raffle entry](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`
- [Paid entry](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`
- [Winner selection](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`

### Administration

- [Raffle management](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`
- [Channel management](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`

### Bot state

- [Raffle state](https://github.com/granit1004/bot-loterry/blob/main/Bot_Antihrist1/bot.py): `Bot_Antihrist1/bot.py`

### Other components

- **Telegram users**
- **Telegram platform**

## Connections

- Telegram users → Button interface: use buttons (evidence: `README.md`)
- Telegram users → Raffle entry: enter raffle (evidence: `README.md`)
- Telegram users → Paid entry: pay to enter (evidence: `README.md`)
- Telegram users → Privacy options: set options (evidence: `README.md`)
- Raffle entry → Raffle state: save participants (evidence: `Bot_Antihrist1/bot.py`)
- Winner selection → Raffle state: read participants (evidence: `Bot_Antihrist1/bot.py`)
- Winner selection → Telegram platform: notify winners (evidence: `Bot_Antihrist1/bot.py`)
- Winner selection → Browse raffles: refresh details (evidence: `Bot_Antihrist1/bot.py`)
- Telegram users → Raffle management: administer (evidence: `README.md`)
- Raffle management → Raffle state: save raffle (evidence: `Bot_Antihrist1/bot.py`)
- Channel management → Telegram platform: broadcast (evidence: `Bot_Antihrist1/bot.py`)
