# damantha126/the-anki-vector architecture

> Architecture diagram of the GitHub repository damantha126/the-anki-vector, 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/damantha126/the-anki-vector
- Repository: https://github.com/damantha126/the-anki-vector

## Overview

Anki Vector is an archived Telegram bot fork, reworked for an anime-centric community. Users interact with the bot through Telegram; its modules cover moderation and group administration, federation bans, welcome flows, custom filters, and anime/media utilities. The graph shows those documented or tree-visible product areas, plus the SQL persistence layer. Source excerpts and the index confirm selected module-to-storage and helper relationships; many feature implementations and their wiring were not sampled, so uncertain links are omitted.

Main entry points: [`AnkiVector/modules/sql/__init__.py`](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/__init__.py) (SQL session setup), [`AnkiVector/__main__.py`](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/__main__.py) (Bot entry point), [`AnkiVector/modules/welcome.py`](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/welcome.py) (Welcome and goodbye), [`AnkiVector/modules/sql/feds_sql.py`](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/feds_sql.py) (Federation records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_entry["Bot entry point<br/>[__main__.py]"]
  node_config["Configuration<br/>[__init__.py]"]
  node_handlers["Command handling<br/>[handlers.py]"]
  node_permissions["Chat permissions<br/>[chat_status.py]"]
  node_formatting["Message formatting<br/>[string_handling.py]"]
end

subgraph group_admin["Group administration"]
  node_moderation["Moderation controls<br/>[disable.py]"]
  node_federations["Federation management<br/>[feds.py]"]
end

subgraph group_community["Community features"]
  node_welcome["Welcome and goodbye<br/>[welcome.py]"]
  node_custom_filters["Custom filters<br/>[cust_filters.py]"]
  node_logging["Chat logging<br/>[log_channel.py]"]
end

subgraph group_content["Anime and media"]
  node_anime["Anime features<br/>[anime.py]"]
  node_memes["Meme features<br/>[memes.py]"]
  node_media_tools["Media utilities<br/>[yt.py]"]
end

subgraph group_persistence["Persistence"]
  node_sql_init["SQL session setup<br/>[__init__.py]"]
  node_database[("Configured SQL database")]
  node_blacklist_store["User blacklist"]
  node_disable_store["Command settings<br/>[disable_sql.py]"]
  node_federation_store["Federation records<br/>[feds_sql.py]"]
  node_filter_store["Filter records"]
  node_welcome_store["Welcome settings<br/>[welcome_sql.py]"]
  node_logging_store["Logging settings<br/>[log_channel_sql.py]"]
end

node_telegram_users(("Telegram users"))
node_telegram["Telegram"]

node_telegram_users -->|"send updates"| node_telegram
node_telegram -->|"deliver updates"| node_entry
node_entry -->|"uses configuration"| node_config
node_entry -->|"starts clients"| node_telegram
node_handlers -->|"checks blacklist"| node_blacklist_store
node_moderation -->|"updates settings"| node_disable_store
node_federations -->|"uses federation records"| node_federation_store
node_custom_filters -->|"uses filter records"| node_filter_store
node_welcome -->|"uses welcome settings"| node_welcome_store
node_welcome -->|"uses logging"| node_logging
node_sql_init -->|"binds session"| node_database
node_welcome_store -->|"uses session"| node_sql_init
node_filter_store -->|"uses session"| node_sql_init
node_federation_store -->|"uses session"| node_sql_init

click node_entry "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/__main__.py"
click node_config "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/__init__.py"
click node_handlers "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/helper_funcs/handlers.py"
click node_permissions "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/helper_funcs/chat_status.py"
click node_formatting "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/helper_funcs/string_handling.py"
click node_moderation "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/disable.py"
click node_federations "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/feds.py"
click node_welcome "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/welcome.py"
click node_custom_filters "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/cust_filters.py"
click node_logging "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/log_channel.py"
click node_anime "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/anime.py"
click node_memes "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/memes.py"
click node_media_tools "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/yt.py"
click node_sql_init "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/__init__.py"
click node_blacklist_store "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/blacklistusers_sql.py"
click node_disable_store "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/disable_sql.py"
click node_federation_store "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/feds_sql.py"
click node_filter_store "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/cust_filters_sql.py"
click node_welcome_store "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/welcome_sql.py"
click node_logging_store "https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/log_channel_sql.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_entry,node_config,node_handlers,node_permissions,node_formatting,node_telegram_users toneBlue
class node_moderation,node_federations toneAmber
class node_welcome,node_custom_filters,node_logging toneMint
class node_anime,node_memes,node_media_tools toneRose
class node_sql_init,node_database,node_blacklist_store,node_disable_store,node_federation_store,node_filter_store,node_welcome_store,node_logging_store,node_telegram toneIndigo
```

## Components

### Bot runtime

- [Bot entry point](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/__main__.py): `AnkiVector/__main__.py`
- [Configuration](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/__init__.py): `AnkiVector/__init__.py`
- [Command handling](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/helper_funcs/handlers.py): `AnkiVector/modules/helper_funcs/handlers.py`
- [Chat permissions](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/helper_funcs/chat_status.py): `AnkiVector/modules/helper_funcs/chat_status.py`
- [Message formatting](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/helper_funcs/string_handling.py): `AnkiVector/modules/helper_funcs/string_handling.py`

### Group administration

- [Moderation controls](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/disable.py): `AnkiVector/modules/disable.py`
- [Federation management](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/feds.py): `AnkiVector/modules/feds.py`

### Community features

- [Welcome and goodbye](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/welcome.py): `AnkiVector/modules/welcome.py`
- [Custom filters](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/cust_filters.py): `AnkiVector/modules/cust_filters.py`
- [Chat logging](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/log_channel.py): `AnkiVector/modules/log_channel.py`

### Anime and media

- [Anime features](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/anime.py): `AnkiVector/modules/anime.py`
- [Meme features](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/memes.py): `AnkiVector/modules/memes.py`
- [Media utilities](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/yt.py): `AnkiVector/modules/yt.py`

### Persistence

- [SQL session setup](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/__init__.py): `AnkiVector/modules/sql/__init__.py`
- **Configured SQL database**
- [User blacklist](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/blacklistusers_sql.py): `AnkiVector/modules/sql/blacklistusers_sql.py`
- [Command settings](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/disable_sql.py): `AnkiVector/modules/sql/disable_sql.py`
- [Federation records](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/feds_sql.py): `AnkiVector/modules/sql/feds_sql.py`
- [Filter records](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/cust_filters_sql.py): `AnkiVector/modules/sql/cust_filters_sql.py`
- [Welcome settings](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/welcome_sql.py): `AnkiVector/modules/sql/welcome_sql.py`
- [Logging settings](https://github.com/damantha126/the-anki-vector/blob/main/AnkiVector/modules/sql/log_channel_sql.py): `AnkiVector/modules/sql/log_channel_sql.py`

### Other components

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

## Connections

- Telegram users → Telegram: send updates
- Telegram → Bot entry point: deliver updates (evidence: `AnkiVector/__main__.py`)
- Bot entry point → Configuration: uses configuration (evidence: `AnkiVector/__main__.py`)
- Bot entry point → Telegram: starts clients (evidence: `AnkiVector/__main__.py`)
- Command handling → User blacklist: checks blacklist (evidence: `AnkiVector/modules/helper_funcs/handlers.py`)
- Moderation controls → Command settings: updates settings (evidence: `AnkiVector/modules/disable.py`)
- Federation management → Federation records: uses federation records (evidence: `AnkiVector/modules/feds.py`)
- Custom filters → Filter records: uses filter records (evidence: `AnkiVector/modules/cust_filters.py`)
- Welcome and goodbye → Welcome settings: uses welcome settings (evidence: `AnkiVector/modules/welcome.py`)
- Welcome and goodbye → Chat logging: uses logging (evidence: `AnkiVector/modules/welcome.py`)
- SQL session setup → Configured SQL database: binds session (evidence: `AnkiVector/modules/sql/__init__.py`)
- Welcome settings → SQL session setup: uses session (evidence: `AnkiVector/modules/sql/welcome_sql.py`)
- Filter records → SQL session setup: uses session (evidence: `AnkiVector/modules/sql/cust_filters_sql.py`)
- Federation records → SQL session setup: uses session (evidence: `AnkiVector/modules/sql/feds_sql.py`)
