How zone24uzz/tg-auto works
This is a Telegram account auto-responder with business-bot and opt-in userbot transports. Incoming messages are normalized and persisted, queued, then processed through rules, media understanding, personal-question triage, AI generation, response safeguards and Telegram delivery; uncertain or personal cases are handed to the owner through the admin bot. The README documents these capabilities, but unsampled modules limit which internal calls can be asserted, so some documented links are dashed. PostgreSQL supports durable queueing and encrypted history; the admin surface also manages settings, rules, history, privacy and usage.
Main entry points: pipeline.ts Reply pipeline · business.handlers.ts Business updates · client.ts PostgreSQL · ai-router.ts AI router
Components 24
Telegram ingress
- Runtime entry
src/main.ts - Business updates
src/telegram/main/business.handlers.ts - Userbot transport
src/telegram/userbot
Reply processing
- Reply pipeline
src/responder/pipeline.ts - Rules and modes
src/rules/rules.engine.ts - Response policy
src/responder/response-policy.ts - Telegram sender
src/responder/reply-sender.ts
AI and media
- Media understanding
src/media/media.service.ts - Personal triage
src/classifiers/classifier.ts - Prompt context
src/conversations/context-builder.ts - AI router
src/ai/router/ai-router.ts - AI providers
src/ai/providers
Owner controls
- Owner attention
src/owner-attention/attention.service.ts - Admin bot
src/telegram/admin - Settings and rules UI
src/telegram/admin/views
Data and operations
- Message history
src/messages/message.repository.ts - Postgres job queue
src/queues/pg-queue.ts - Worker runner
src/workers/worker-runner.ts - Raw media storage
src/media/storage/storage.ts - Audit log
src/audit/audit.service.ts - Privacy and retention
src/privacy/privacy.service.ts - Usage statistics
src/statistics/usage.service.ts - PostgreSQL
src/database/client.ts
Other components
- Telegram chats
Connections 28
- Telegram chats → Business updates: sends updates
README.md - Runtime entry → Business updates: starts
src/main.ts - Runtime entry → Admin bot: starts
src/main.ts - Telegram chats → Userbot transport: MTProto chats
README.md - Business updates → Message history: stores messages
src/telegram/main/business.handlers.ts - Business updates → Postgres job queue: enqueues work
src/telegram/main/business.handlers.ts - Worker runner → Postgres job queue: claims jobs
src/workers/worker-runner.ts - Worker runner → Reply pipeline: runs replies
- Reply pipeline → Rules and modes: checks rules
src/responder/pipeline.ts - Reply pipeline → Media understanding: processes media
src/responder/pipeline.ts - Reply pipeline → Personal triage: triages questions
src/responder/pipeline.ts - Reply pipeline → Prompt context: builds context
src/responder/pipeline.ts - Reply pipeline → AI router: requests generation
- AI router → AI providers: dispatches calls
- Reply pipeline → Response policy: filters reply
src/responder/pipeline.ts - Reply pipeline → Telegram sender: sends reply
src/responder/pipeline.ts - Reply pipeline → Owner attention: queues owner cases
src/responder/pipeline.ts - Owner attention → Admin bot: notifies owner
src/owner-attention/attention.service.ts - Admin bot → Settings and rules UI: routes controls
src/telegram/admin/views/main.ts - Settings and rules UI → Audit log: records changes
- Privacy and retention → Message history: deletes user data
- Privacy and retention → Raw media storage: cleans media
src/privacy/privacy.service.ts - Media understanding → Raw media storage: retains media
src/media/media.service.ts - Message history → PostgreSQL: reads and writes
src/messages/message.repository.ts - Postgres job queue → PostgreSQL: persists jobs
src/queues/pg-queue.ts - Audit log → PostgreSQL: writes audit rows
src/audit/audit.service.ts - Usage statistics → PostgreSQL: records usage
src/statistics/usage.service.ts - AI router → Usage statistics: tracks usage
src/ai/router/ai-router.ts