# paparumskiy/plast_bot architecture

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

- Interactive diagram: https://gitdiagram.com/paparumskiy/plast_bot
- Repository: https://github.com/paparumskiy/plast_bot

## Overview

This is a small Telegram bot: it polls for updates, handles `/start` and text messages, deletes messages containing configured profanity, and replies to other text using a simple greeting rule. A separate SQLAlchemy user model is present, but the sampled code does not connect it to the bot; `database/basic.py` contains only empty settings. Relationships shown are limited to those visible in `main.py`.

Main entry points: [`main.py`](https://github.com/paparumskiy/plast_bot/blob/main/main.py) (Message handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_app["Polling application<br/>[main.py]"]
  node_commands["Start command<br/>[main.py]"]
  node_messages["Message handling<br/>[main.py]"]
  node_responses["Text response rules<br/>[main.py]"]
end

subgraph group_data["User data"]
  node_user_model["User ORM model<br/>[users.py]"]
end

node_user(("Telegram user"))
node_telegram["Telegram platform"]

node_user -->|"sends messages"| node_telegram
node_app -->|"polls updates"| node_telegram
node_app -->|"registers command"| node_commands
node_app -->|"registers text handler"| node_messages
node_telegram -.->|"dispatches updates"| node_commands
node_telegram -.->|"dispatches updates"| node_messages
node_messages -->|"gets response"| node_responses
node_messages -->|"replies or deletes"| node_telegram

click node_app "https://github.com/paparumskiy/plast_bot/blob/main/main.py"
click node_commands "https://github.com/paparumskiy/plast_bot/blob/main/main.py"
click node_messages "https://github.com/paparumskiy/plast_bot/blob/main/main.py"
click node_responses "https://github.com/paparumskiy/plast_bot/blob/main/main.py"
click node_user_model "https://github.com/paparumskiy/plast_bot/blob/main/models/users.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_app,node_commands,node_messages,node_responses,node_user toneBlue
class node_user_model toneAmber
class node_telegram toneIndigo
```

## Components

### Bot runtime

- [Polling application](https://github.com/paparumskiy/plast_bot/blob/main/main.py): `main.py`
- [Start command](https://github.com/paparumskiy/plast_bot/blob/main/main.py): `main.py`
- [Message handling](https://github.com/paparumskiy/plast_bot/blob/main/main.py): `main.py`
- [Text response rules](https://github.com/paparumskiy/plast_bot/blob/main/main.py): `main.py`

### User data

- [User ORM model](https://github.com/paparumskiy/plast_bot/blob/main/models/users.py): `models/users.py`

### Other components

- **Telegram user**
- **Telegram platform**

## Connections

- Telegram user → Telegram platform: sends messages
- Polling application → Telegram platform: polls updates (evidence: `main.py`)
- Polling application → Start command: registers command (evidence: `main.py`)
- Polling application → Message handling: registers text handler (evidence: `main.py`)
- Telegram platform → Start command: dispatches updates
- Telegram platform → Message handling: dispatches updates
- Message handling → Text response rules: gets response (evidence: `main.py`)
- Message handling → Telegram platform: replies or deletes (evidence: `main.py`)
