How ghostoraner/bot-assistant-via-telegramm works
A Telegram long-polling assistant routes user messages into menu/settings, job search, task and planner management, or Groq chat. Search collects and category-filters listings from freelance sources; users can save a result to the planner. Handlers read and write user, task, and planner records through async SQLAlchemy sessions, while locale helpers supply RU/EN text. The graph follows README-described runtime capabilities and excerpted calls; source-level evidence for middleware wiring and the additional AI service wrapper was not shown, so those links are omitted.
Main entry points: main.py Polling dispatcher · job_search.py Job search handler · menu.py Menu and settings · engine.py Async DB sessions
Components 14
Bot runtime
- Polling dispatcher
app/main.py
User features
- Menu and settings
app/handlers/menu.py - AI chat handler
app/handlers/ai_chat.py - Job search handler
app/handlers/job_search.py - Tasks and planner
app/handlers/tasks_planner.py
External services
- Telegram Bot API
- Listing parser
app/services/parser_service.py - Freelance sources
- Groq chat API
Persistence and language
- RU/EN messages
app/locales.py - Async DB sessions
app/database/engine.py - User/task/plan models
app/database/models.py - MySQL database
Other components
- Telegram user
Connections 23
- Telegram user → Telegram Bot API: sends messages
README.md - Telegram Bot API → Polling dispatcher: delivers updates
README.md - Polling dispatcher → Telegram Bot API: long polls
app/main.py - Polling dispatcher → Menu and settings: registers router
app/main.py - Polling dispatcher → AI chat handler: registers router
app/main.py - Polling dispatcher → Job search handler: registers router
app/main.py - Polling dispatcher → Tasks and planner: registers router
app/main.py - Menu and settings → Async DB sessions: opens sessions
app/handlers/menu.py - Menu and settings → User/task/plan models: reads and updates
app/handlers/menu.py - Menu and settings → RU/EN messages: gets messages
app/handlers/menu.py - AI chat handler → Menu and settings: gets language and keyboard
app/handlers/ai_chat.py - AI chat handler → RU/EN messages: gets messages
app/handlers/ai_chat.py - AI chat handler → Groq chat API: requests completion
app/handlers/ai_chat.py - Job search handler → Listing parser: requests listings
app/handlers/job_search.py - Listing parser → Freelance sources: fetches listings
app/services/parser_service.py - Job search handler → Async DB sessions: opens sessions
app/handlers/job_search.py - Job search handler → User/task/plan models: saves planner entry
app/handlers/job_search.py - Job search handler → RU/EN messages: gets messages
app/handlers/job_search.py - Tasks and planner → Async DB sessions: opens sessions
app/handlers/tasks_planner.py - Tasks and planner → User/task/plan models: queries and writes
app/handlers/tasks_planner.py - Tasks and planner → RU/EN messages: gets messages
app/handlers/tasks_planner.py - Async DB sessions → MySQL database: connects asynchronously
README.md - Async DB sessions → User/task/plan models: uses mapped entities