lily_website

πŸ“‚ Bot Menu Logic

⬅️ Back 🏠 Docs Root

Business logic layer for the Bot Menu feature.

πŸ—ΊοΈ Module Map

Component Description
πŸ“œ Orchestrator Main coordinator: menu assembly, RBAC, navigation

πŸ—οΈ Class: BotMenuOrchestrator

Located in: src/telegram_bot/features/telegram/bot_menu/logic/orchestrator.py

Responsibilities

  1. Menu Assembly: Fetches all available feature configurations via the MenuDiscoveryProvider.
  2. Access Control: Validates user permissions (Admin/Superuser) for specific menu buttons.
  3. Navigation Handling: Processes menu clicks and prepares state transitions to target features.

Key Methods

render_menu(user_id: int)

handle_menu_click(target: str, user_id: int)

πŸ”„ State Management

The bot_menu operates in the BotMenuStates.main state. When a user navigates to another feature, the orchestrator provides the new state name, and the Director updates the FSM context.