lily_website

πŸ“‚ Bot Menu (Dashboard)

⬅️ Back 🏠 Docs Root

The bot_menu feature is the central hub (Dashboard) of the Telegram Bot. It provides a persistent interface with buttons that allow users to navigate between different installed features and switch between User and Admin modes.

πŸ—ΊοΈ Module Map

Component Description
πŸ“‚ Handlers Entry points and callback processing
πŸ“‚ Logic Business logic and orchestrator
πŸ“‚ Contracts Data access interfaces (MenuDiscoveryProvider)
πŸ“‚ UI Message rendering and keyboards
πŸ“‚ Resources Static texts and constants

πŸ“‹ feature_setting.py

class BotMenuStates(StatesGroup):
    main = State()

STATES = BotMenuStates
GARBAGE_COLLECT = True

πŸ”„ Logic Flow

  1. Entry: User triggers the menu (e.g., via /start).
  2. Mode Selection: Orchestrator determines if the user should see the Admin or User dashboard.
  3. Discovery & Filtering: Orchestrator fetches registered buttons and filters them by user permissions.
  4. Rendering: BotMenuUI creates a keyboard with the allowed buttons.
  5. Navigation: When a button is clicked, the orchestrator either switches the dashboard mode or uses the Director to move to another feature.

🧩 Menu Integration

Other features appear in this menu by defining a MENU_CONFIG in their own feature_setting.py. The bot_menu itself does not need to be modified to add new buttons.