How zytyan/suppbot works
suppbot is a Telegram auto-archiving bot with a web administration interface and full-text article search. Its main flow crawls article pages and magnet hashes, persists jobs, downloads torrents, processes media, then publishes files and links through Telegram; the worker owns this orchestration. Separate branches index article text for search and expose runtime/job state to administrators. Edges below follow README statements or shown calls/import references; unsampled subsystems are included at documented directory paths, with uncertain wiring omitted.
Main entry points: main.ts Application startup · worker.ts Job orchestrator · store.ts Archive job store · telegram.ts Telegram publishing
Components 21
Article ingestion
- Article crawler
src/crawler.ts - Scheduled discovery
src/worker.ts - Cover retrieval
src/article-photo.ts
Archiving pipeline
- Archive job store
src/store.ts - Job orchestrator
src/worker.ts - Torrent adapter
src/qbit.ts - Media processing
src/media.ts
Telegram and search
- Telegram publishing
src/telegram.ts - Indexing service
src/search-service.ts - Search index
src/search-store.ts - Search commands
src/search-bot.ts - Command definitions
src/bot-commands.ts
Operations
- Application startup
src/main.ts - Configuration
src/config.ts - Admin interface
src/admin.ts - Live runtime state
src/runtime.ts - Admin page assets
web/static
Other components
- Operator
- Telegram users
- Article site
- Telegram Bot API
Connections 33
- Operator → Application startup: starts service
README.md - Application startup → Configuration: loads config
src/main.ts - Application startup → Archive job store: initializes
src/main.ts - Application startup → Job orchestrator: starts workers
src/main.ts - Application startup → Scheduled discovery: starts crawl
src/main.ts - Application startup → Indexing service: starts indexing
src/main.ts - Application startup → Telegram publishing: creates bot
src/main.ts - Application startup → Admin interface: starts server
README.md - Scheduled discovery → Article crawler: fetches articles
src/worker.ts - Scheduled discovery → Archive job store: queues articles
src/worker.ts - Article crawler → Article site: fetches pages
src/crawler.ts - Job orchestrator → Archive job store: claims and updates
src/worker.ts - Job orchestrator → Article crawler: recovers articles
src/worker.ts - Job orchestrator → Torrent adapter: downloads torrents
- Job orchestrator → Media processing: processes files
- Job orchestrator → Telegram publishing: publishes archive
src/worker.ts - Telegram publishing → Cover retrieval: loads cover
src/telegram.ts - Telegram publishing → Telegram Bot API: sends messages
src/telegram.ts - Telegram users → Telegram Bot API: sends updates
- Application startup → Command definitions: syncs commands
src/main.ts - Application startup → Live runtime state: tracks runtime
src/main.ts - Indexing service → Article crawler: fetches documents
src/search-service.ts - Indexing service → Archive job store: seeds history
src/search-service.ts - Indexing service → Search index: queues and saves
src/search-service.ts - Telegram publishing → Search commands: registers search
src/telegram.ts - Search commands → Search index: queries index
src/search-bot.ts - Search commands → Archive job store: adds archive links
src/search-bot.ts - Search commands → Command definitions: uses definitions
src/search-bot.ts - Admin interface → Archive job store: reads and manages
src/admin.ts - Admin interface → Live runtime state: reads snapshot
src/admin.ts - Operator → Admin interface: manages archives
README.md - Admin interface → Admin page assets: serves assets
- Live runtime state → Search index: reports search status
src/runtime.ts