How callmemathew/telegram-bot works
This is a Telegram live-support bot: a user selects a language, sends a message, and chats through a per-user topic in the managers’ forum. The webhook entry point routes updates to handlers, which delegate support behavior to services; SQLite persists user/session metadata and message records. The graph includes documented status, session, and language-UI capabilities, but some implementation details are unsampled, so those links are marked unverified rather than asserted as source-confirmed.
Main entry points: app.go Webhook application · service.go Support service · callback.go Language callbacks · flow_user.go User-to-manager routing
Components 22
Application entry
- Bot bootstrap
cmd/bot/main.go - Runtime configuration
internal/config/config.go - Webhook application
internal/config/app/app.go
Telegram interaction
- Update router
internal/config/handlers/handlers.go - Language callbacks
internal/config/handlers/callback.go - Private message handling
internal/config/handlers/user.go - Menu and response text
internal/config/handlers/texts.go
Support workflows
- Support service
internal/config/service/service.go - User and language setup
internal/config/service/user.go - User-to-manager routing
internal/config/service/flow_user.go - Manager-to-user routing
internal/config/service/flow_manager.go - Session status
internal/config/service/flow_manager.go - Language UI refresh
internal/config/service/ui_lang.go - Language menu
internal/config/service/lang_menu.go - Start guidance
internal/config/service/start_hint.go - Manager info card
internal/config/service/pinned_card.go - Message and topic helpers
internal/config/service/helpers.go
Persistent data
- SQLite store
internal/config/storage/store.go - User and session records
internal/config/storage/users.go - Message history
internal/config/storage/messages.go
Other components
- User or manager
- Telegram API
Connections 31
- User or manager → Telegram API: sends updates
README.md - Telegram API → Webhook application: delivers webhook
internal/config/app/app.go - Bot bootstrap → Runtime configuration: loads settings
cmd/bot/main.go - Bot bootstrap → Webhook application: starts application
cmd/bot/main.go - Runtime configuration → Webhook application: configures
internal/config/app/app.go - Webhook application → SQLite store: opens and initializes
internal/config/app/app.go - Webhook application → Support service: constructs
internal/config/app/app.go - Webhook application → Update router: constructs and dispatches
internal/config/app/app.go - Update router → Language callbacks: routes callbacks
internal/config/handlers/handlers.go - Update router → Private message handling: routes messages
internal/config/handlers/handlers.go - Private message handling → Support service: handles user messages
- Language callbacks → Support service: updates language and UI
internal/config/handlers/callback.go - Language callbacks → Menu and response text: sends language text
internal/config/handlers/callback.go - Support service → User and language setup: delegates setup
- Support service → User-to-manager routing: delegates routing
- Support service → Manager-to-user routing: delegates routing
- User-to-manager routing → SQLite store: reads and saves
internal/config/service/flow_user.go - Manager-to-user routing → SQLite store: looks up and saves
internal/config/service/flow_manager.go - User-to-manager routing → Telegram API: creates topic and forwards
internal/config/service/flow_user.go - Manager-to-user routing → Telegram API: relays replies
internal/config/service/flow_manager.go - Language callbacks → User and session records: persists language
internal/config/handlers/callback.go - User-to-manager routing → Manager info card: refreshes card
internal/config/service/flow_user.go - User-to-manager routing → Message and topic helpers: uses topic and media helpers
internal/config/service/flow_user.go - Manager-to-user routing → Message and topic helpers: uses media helpers
internal/config/service/flow_manager.go - Language callbacks → Language UI refresh: refreshes interface
internal/config/handlers/callback.go - Language menu → Telegram API: presents choices
README.md - Start guidance → Telegram API: shows guidance
README.md - Session status → Telegram API: updates user status
README.md - SQLite store → User and session records: stores user state
internal/config/storage/users.go - SQLite store → Message history: stores message history
internal/config/storage/messages.go - User and session records → Message history