# maxxsalov/bot_sanya architecture

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

- Interactive diagram: https://gitdiagram.com/maxxsalov/bot_sanya
- Repository: https://github.com/maxxsalov/bot_sanya

## Overview

This is a small Telegram joke bot. A user sends /start to receive a welcome sticker and message, or sends text to trigger a meme response. The bot selects a numbered image from `mem/` and sends it through Telegram. The text condition in `bot.py` is always truthy because it includes the nonempty string `'саня'`, so the fallback message is unreachable. Evidence is limited to the README and the sampled `bot.py` and `config.py`.

Main entry points: [`bot.py`](https://github.com/maxxsalov/bot_sanya/blob/master/bot.py) (Bot polling), [`config.py`](https://github.com/maxxsalov/bot_sanya/blob/master/config.py) (Bot token), [`static`](https://github.com/maxxsalov/bot_sanya/tree/master/static) (Welcome sticker), [`mem`](https://github.com/maxxsalov/bot_sanya/tree/master/mem) (Meme images)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Telegram user"))
node_runtime["Bot polling<br/>[bot.py]"]
node_start["Start handler<br/>[bot.py]"]
node_text["Text handler<br/>[bot.py]"]
node_config["Bot token<br/>[config.py]"]
node_welcome["Welcome sticker"]
node_memes["Meme images"]
node_telegram{{"Telegram API"}}

node_runtime -->|"reads token"| node_config
node_runtime -->|"polls updates"| node_telegram
node_user -->|"sends messages"| node_runtime
node_runtime -->|"dispatches /start"| node_start
node_runtime -->|"dispatches text"| node_text
node_start -->|"reads sticker"| node_welcome
node_start -->|"sends welcome"| node_telegram
node_text -->|"reads selected image"| node_memes
node_text -->|"sends photo"| node_telegram

click node_runtime "https://github.com/maxxsalov/bot_sanya/blob/master/bot.py"
click node_start "https://github.com/maxxsalov/bot_sanya/blob/master/bot.py"
click node_text "https://github.com/maxxsalov/bot_sanya/blob/master/bot.py"
click node_config "https://github.com/maxxsalov/bot_sanya/blob/master/config.py"
click node_welcome "https://github.com/maxxsalov/bot_sanya/tree/master/static"
click node_memes "https://github.com/maxxsalov/bot_sanya/tree/master/mem"

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_user toneBlue
class node_runtime,node_config,node_welcome,node_memes toneTeal
class node_start,node_text,node_telegram toneMint
```

## Components

### Other components

- **Telegram user**
- [Bot polling](https://github.com/maxxsalov/bot_sanya/blob/master/bot.py): `bot.py`
- [Start handler](https://github.com/maxxsalov/bot_sanya/blob/master/bot.py): `bot.py`
- [Text handler](https://github.com/maxxsalov/bot_sanya/blob/master/bot.py): `bot.py`
- [Bot token](https://github.com/maxxsalov/bot_sanya/blob/master/config.py): `config.py`
- [Welcome sticker](https://github.com/maxxsalov/bot_sanya/tree/master/static): `static`
- [Meme images](https://github.com/maxxsalov/bot_sanya/tree/master/mem): `mem`
- **Telegram API**

## Connections

- Bot polling → Bot token: reads token (evidence: `bot.py`)
- Bot polling → Telegram API: polls updates (evidence: `bot.py`)
- Telegram user → Bot polling: sends messages (evidence: `bot.py`)
- Bot polling → Start handler: dispatches /start (evidence: `bot.py`)
- Bot polling → Text handler: dispatches text (evidence: `bot.py`)
- Start handler → Welcome sticker: reads sticker (evidence: `bot.py`)
- Start handler → Telegram API: sends welcome (evidence: `bot.py`)
- Text handler → Meme images: reads selected image (evidence: `bot.py`)
- Text handler → Telegram API: sends photo (evidence: `bot.py`)
