How cwr-su/manager_cw_bot works
Manager CW Bot API is a Python library for a Telegram bot, with business-management and subscription workflows. The visible entry point is main.py importing the business bot; the bot coordinates user/admin interactions, while feature modules handle tickets, email, promotions, payments/refunds, and AI features. Database operations and PDF generation provide internal services. The README identifies the product but does not describe its feature flow; some feature links below are therefore dashed and unverified rather than asserted as calls.
Main entry points: business.py Business bot · handler_db_sub_operations.py Database operations · refund.py Refunds · handler_successful_payment.py Successful payments
Components 25
Bot orchestration
- Bot entry
main.py - Business bot
manager_cw_bot_api/business.py - Menu buttons
manager_cw_bot_api/buttons.py
User support
- Business requests
manager_cw_bot_api/business_handler.py - Ticket system
manager_cw_bot_api/tickets.py - Email settings
manager_cw_bot_api/handler_email.py - Email sender
manager_cw_bot_api/handler_email_sender.py
Subscriptions and payments
- Promo management
manager_cw_bot_api/handler_promo.py - Successful payments
manager_cw_bot_api/handler_successful_payment.py - Invoice handling
manager_cw_bot_api/send_invoice.py - YooKassa handling
manager_cw_bot_api/handler_yookassa.py - Refunds
manager_cw_bot_api/refund.py
Shared services
- Database operations
manager_cw_bot_api/handler_db_sub_operations.py - MySQL connection
manager_cw_bot_api/mysql_connection.py - MySQL database
- PDF generation
manager_cw_bot_api/pdf_generate_data.py - Conversation states
manager_cw_bot_api/fsm_handler.py - Analytics
manager_cw_bot_api/analytics.py
AI features
- GigaChat features
manager_cw_bot_api/gigachatai.py - AI image features
manager_cw_bot_api/giga_images.py - GigaChat requests
manager_cw_bot_api/giga_request.py
Other components
- Telegram user
- Telegram
- Bot administrator
- SMTP service
Connections 38
- Telegram user → Telegram: sends updates
- Telegram → Bot entry: delivers updates
- Bot entry → Business bot: imports
main.py - Business bot → Telegram: sends bot messages
- Business bot → Ticket system: routes ticket answers
manager_cw_bot_api/business.py - Business bot → Successful payments: handles payment
manager_cw_bot_api/business.py - Business bot → Promo management: opens promo menu
manager_cw_bot_api/business.py - Business bot → Menu buttons: builds menus
manager_cw_bot_api/business.py - Business bot → Refunds: dispatches refund
manager_cw_bot_api/business.py - Business bot → GigaChat features: dispatches AI
manager_cw_bot_api/business.py - Business bot → AI image features: dispatches image requests
manager_cw_bot_api/business.py - Business requests → Menu buttons: builds menus
manager_cw_bot_api/business_handler.py - Business requests → Conversation states: sets conversation state
manager_cw_bot_api/business_handler.py - Menu buttons → Database operations: reads user data
manager_cw_bot_api/buttons.py - Menu buttons → Email sender: reads admin email
manager_cw_bot_api/buttons.py - Ticket system → Database operations: ticket data access
manager_cw_bot_api/tickets.py - Email settings → Database operations: email data access
manager_cw_bot_api/handler_email.py - Email settings → Email sender: reads admin email
manager_cw_bot_api/handler_email.py - Promo management → Database operations: checks and stores promos
manager_cw_bot_api/handler_promo.py - Successful payments → Database operations: records subscription
manager_cw_bot_api/handler_successful_payment.py - Successful payments → PDF generation: generates receipt
manager_cw_bot_api/handler_successful_payment.py - Successful payments → Email sender: emails receipt
manager_cw_bot_api/handler_successful_payment.py - Invoice handling → YooKassa handling: uses payment handling
manager_cw_bot_api/send_invoice.py - Invoice handling → Successful payments: dispatches payment result
manager_cw_bot_api/send_invoice.py - YooKassa handling → Database operations: accesses payment data
manager_cw_bot_api/handler_yookassa.py - Refunds → Database operations: reads subscription data
manager_cw_bot_api/refund.py - Refunds → PDF generation: generates refund receipt
manager_cw_bot_api/refund.py - Refunds → Email sender: emails refund receipt
manager_cw_bot_api/refund.py - Refunds → Telegram: requests refunds
- Database operations → MySQL connection: opens connections
manager_cw_bot_api/handler_db_sub_operations.py - MySQL connection → MySQL database: connects
- Email sender → SMTP service: sends mail
- Analytics → Database operations: records analytics
manager_cw_bot_api/analytics.py - GigaChat features → GigaChat requests: sends requests
manager_cw_bot_api/gigachatai.py - AI image features → GigaChat requests: sends requests
manager_cw_bot_api/giga_images.py - GigaChat features → Conversation states: uses conversation state
manager_cw_bot_api/gigachatai.py - AI image features → Conversation states: uses conversation state
manager_cw_bot_api/giga_images.py - Bot administrator → Telegram: administers bot