# robbtg/evamaria-new architecture

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

- Interactive diagram: https://gitdiagram.com/robbtg/evamaria-new
- Repository: https://github.com/robbtg/evamaria-new

## Overview

Eva Maria is a Telegram media-search bot. Users discover indexed files through automatic or inline search, then receive matching Telegram media; admins can populate the index from channels. Separate capabilities include per-chat manual filters, IMDb/search information, file-link generation, group connections, and user/chat moderation. MongoDB-backed media, filter, connection, and user/chat state support these features. The available excerpts show indexing and media-search storage behavior; several plugin relationships are inferred only from the source index, so those links are marked unverified.

Main entry points: [`database/ia_filterdb.py`](https://github.com/robbtg/evamaria-new/blob/master/database/ia_filterdb.py) (Indexed media), [`database/users_chats_db.py`](https://github.com/robbtg/evamaria-new/blob/master/database/users_chats_db.py) (Users and chats), [`bot.py`](https://github.com/robbtg/evamaria-new/blob/master/bot.py) (Bot startup), [`plugins/pm_filter.py`](https://github.com/robbtg/evamaria-new/blob/master/plugins/pm_filter.py) (Auto filter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_bot["Bot startup<br/>[bot.py]"]
  node_config["Runtime settings<br/>[info.py]"]
  node_utils["Shared utilities<br/>[utils.py]"]
  node_templates["Bot text templates<br/>[Script.py]"]
end

subgraph group_discovery["Media discovery"]
  node_autofilter["Auto filter<br/>[pm_filter.py]"]
  node_inline["Inline search<br/>[inline.py]"]
  node_indexing["Channel indexing<br/>[index.py]"]
  node_filelinks["File links<br/>[genlink.py]"]
end

subgraph group_operations["Bot operations"]
  node_admincommands["Admin commands<br/>[commands.py]"]
  node_manualfilters["Manual filters<br/>[filters.py]"]
  node_connections["Chat connections<br/>[connection.py]"]
  node_welcome["Welcome and moderation<br/>[p_ttishow.py]"]
  node_broadcast["Broadcast<br/>[broadcast.py]"]
  node_bans["Ban management<br/>[banned.py]"]
  node_misc["IMDb and utilities<br/>[misc.py]"]
  node_channels["Channel management<br/>[channel.py]"]
end

subgraph group_persistence["MongoDB persistence"]
  node_media_store[("Indexed media<br/>[ia_filterdb.py]")]
  node_filter_store[("Chat filters<br/>[filters_mdb.py]")]
  node_connection_store[("Connection state<br/>[connections_mdb.py]")]
  node_users_store[("Users and chats<br/>[users_chats_db.py]")]
end

node_telegram(("Telegram users"))
node_mongodb[("MongoDB")]

node_telegram -.->|"uses bot"| node_bot
node_bot -.->|"loads settings"| node_config
node_bot -.->|"initializes"| node_media_store
node_bot -.->|"initializes"| node_users_store
node_bot -.->|"uses"| node_utils
node_indexing -->|"saves files"| node_media_store
node_autofilter -->|"searches files"| node_media_store
node_autofilter -.->|"checks filters"| node_filter_store
node_inline -.->|"searches files"| node_media_store
node_filelinks -.->|"retrieves files"| node_media_store
node_admincommands -.->|"manages files"| node_media_store
node_admincommands -.->|"reads user data"| node_users_store
node_manualfilters -.->|"manages filters"| node_filter_store
node_connections -.->|"manages connections"| node_connection_store
node_welcome -.->|"reads chat state"| node_users_store
node_broadcast -.->|"gets recipients"| node_users_store
node_bans -.->|"updates bans"| node_users_store
node_misc -.->|"uses helpers"| node_utils
node_autofilter -.->|"uses helpers"| node_utils
node_admincommands -.->|"uses text"| node_templates
node_media_store -->|"reads and writes"| node_mongodb
node_filter_store -->|"reads and writes"| node_mongodb
node_connection_store -->|"reads and writes"| node_mongodb
node_users_store -->|"reads and writes"| node_mongodb

click node_bot "https://github.com/robbtg/evamaria-new/blob/master/bot.py"
click node_config "https://github.com/robbtg/evamaria-new/blob/master/info.py"
click node_utils "https://github.com/robbtg/evamaria-new/blob/master/utils.py"
click node_templates "https://github.com/robbtg/evamaria-new/blob/master/Script.py"
click node_autofilter "https://github.com/robbtg/evamaria-new/blob/master/plugins/pm_filter.py"
click node_inline "https://github.com/robbtg/evamaria-new/blob/master/plugins/inline.py"
click node_indexing "https://github.com/robbtg/evamaria-new/blob/master/plugins/index.py"
click node_filelinks "https://github.com/robbtg/evamaria-new/blob/master/plugins/genlink.py"
click node_admincommands "https://github.com/robbtg/evamaria-new/blob/master/plugins/commands.py"
click node_manualfilters "https://github.com/robbtg/evamaria-new/blob/master/plugins/filters.py"
click node_connections "https://github.com/robbtg/evamaria-new/blob/master/plugins/connection.py"
click node_welcome "https://github.com/robbtg/evamaria-new/blob/master/plugins/p_ttishow.py"
click node_broadcast "https://github.com/robbtg/evamaria-new/blob/master/plugins/broadcast.py"
click node_bans "https://github.com/robbtg/evamaria-new/blob/master/plugins/banned.py"
click node_misc "https://github.com/robbtg/evamaria-new/blob/master/plugins/misc.py"
click node_channels "https://github.com/robbtg/evamaria-new/blob/master/plugins/channel.py"
click node_media_store "https://github.com/robbtg/evamaria-new/blob/master/database/ia_filterdb.py"
click node_filter_store "https://github.com/robbtg/evamaria-new/blob/master/database/filters_mdb.py"
click node_connection_store "https://github.com/robbtg/evamaria-new/blob/master/database/connections_mdb.py"
click node_users_store "https://github.com/robbtg/evamaria-new/blob/master/database/users_chats_db.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,node_config,node_utils,node_templates,node_telegram toneBlue
class node_autofilter,node_inline,node_indexing,node_filelinks,node_mongodb toneAmber
class node_admincommands,node_manualfilters,node_connections,node_welcome,node_broadcast,node_bans,node_misc,node_channels toneMint
class node_media_store,node_filter_store,node_connection_store,node_users_store toneRose
```

## Components

### Bot runtime

- [Bot startup](https://github.com/robbtg/evamaria-new/blob/master/bot.py): `bot.py`
- [Runtime settings](https://github.com/robbtg/evamaria-new/blob/master/info.py): `info.py`
- [Shared utilities](https://github.com/robbtg/evamaria-new/blob/master/utils.py): `utils.py`
- [Bot text templates](https://github.com/robbtg/evamaria-new/blob/master/Script.py): `Script.py`

### Media discovery

- [Auto filter](https://github.com/robbtg/evamaria-new/blob/master/plugins/pm_filter.py): `plugins/pm_filter.py`
- [Inline search](https://github.com/robbtg/evamaria-new/blob/master/plugins/inline.py): `plugins/inline.py`
- [Channel indexing](https://github.com/robbtg/evamaria-new/blob/master/plugins/index.py): `plugins/index.py`
- [File links](https://github.com/robbtg/evamaria-new/blob/master/plugins/genlink.py): `plugins/genlink.py`

### Bot operations

- [Admin commands](https://github.com/robbtg/evamaria-new/blob/master/plugins/commands.py): `plugins/commands.py`
- [Manual filters](https://github.com/robbtg/evamaria-new/blob/master/plugins/filters.py): `plugins/filters.py`
- [Chat connections](https://github.com/robbtg/evamaria-new/blob/master/plugins/connection.py): `plugins/connection.py`
- [Welcome and moderation](https://github.com/robbtg/evamaria-new/blob/master/plugins/p_ttishow.py): `plugins/p_ttishow.py`
- [Broadcast](https://github.com/robbtg/evamaria-new/blob/master/plugins/broadcast.py): `plugins/broadcast.py`
- [Ban management](https://github.com/robbtg/evamaria-new/blob/master/plugins/banned.py): `plugins/banned.py`
- [IMDb and utilities](https://github.com/robbtg/evamaria-new/blob/master/plugins/misc.py): `plugins/misc.py`
- [Channel management](https://github.com/robbtg/evamaria-new/blob/master/plugins/channel.py): `plugins/channel.py`

### MongoDB persistence

- [Indexed media](https://github.com/robbtg/evamaria-new/blob/master/database/ia_filterdb.py): `database/ia_filterdb.py`
- [Chat filters](https://github.com/robbtg/evamaria-new/blob/master/database/filters_mdb.py): `database/filters_mdb.py`
- [Connection state](https://github.com/robbtg/evamaria-new/blob/master/database/connections_mdb.py): `database/connections_mdb.py`
- [Users and chats](https://github.com/robbtg/evamaria-new/blob/master/database/users_chats_db.py): `database/users_chats_db.py`

### Other components

- **Telegram users**
- **MongoDB**

## Connections

- Telegram users → Bot startup: uses bot (evidence: `README.md`)
- Bot startup → Runtime settings: loads settings (evidence: `bot.py`)
- Bot startup → Indexed media: initializes (evidence: `bot.py`)
- Bot startup → Users and chats: initializes (evidence: `bot.py`)
- Bot startup → Shared utilities: uses (evidence: `bot.py`)
- Channel indexing → Indexed media: saves files (evidence: `plugins/index.py`)
- Auto filter → Indexed media: searches files (evidence: `plugins/pm_filter.py`)
- Auto filter → Chat filters: checks filters (evidence: `plugins/pm_filter.py`)
- Inline search → Indexed media: searches files (evidence: `plugins/inline.py`)
- File links → Indexed media: retrieves files (evidence: `plugins/genlink.py`)
- Admin commands → Indexed media: manages files (evidence: `plugins/commands.py`)
- Admin commands → Users and chats: reads user data (evidence: `plugins/commands.py`)
- Manual filters → Chat filters: manages filters (evidence: `plugins/filters.py`)
- Chat connections → Connection state: manages connections (evidence: `plugins/connection.py`)
- Welcome and moderation → Users and chats: reads chat state (evidence: `plugins/p_ttishow.py`)
- Broadcast → Users and chats: gets recipients (evidence: `plugins/broadcast.py`)
- Ban management → Users and chats: updates bans (evidence: `plugins/banned.py`)
- IMDb and utilities → Shared utilities: uses helpers (evidence: `plugins/misc.py`)
- Auto filter → Shared utilities: uses helpers (evidence: `plugins/pm_filter.py`)
- Admin commands → Bot text templates: uses text (evidence: `plugins/commands.py`)
- Indexed media → MongoDB: reads and writes (evidence: `database/ia_filterdb.py`)
- Chat filters → MongoDB: reads and writes (evidence: `database/filters_mdb.py`)
- Connection state → MongoDB: reads and writes (evidence: `database/connections_mdb.py`)
- Users and chats → MongoDB: reads and writes (evidence: `database/users_chats_db.py`)
