lily_website

📜 View DTO

⬅️ Back 🏠 Docs Root

This module defines several Data Transfer Objects (DTOs) used for structuring and passing UI-related data throughout the Telegram bot application. These DTOs ensure consistent communication between different layers, especially between orchestrators, UI services, and message sending mechanisms.

ViewResultDTO

class ViewResultDTO(BaseModel):
    text: str
    kb: InlineKeyboardMarkup | None = None
    model_config = ConfigDict(arbitrary_types_allowed=True)

A DTO representing a single message to be sent to Telegram, comprising its text content and an optional inline keyboard.

MessageCoordsDTO

class MessageCoordsDTO(BaseModel):
    chat_id: int
    message_id: int

A DTO representing the coordinates (chat ID and message ID) of a specific message in Telegram. This is useful for editing or deleting messages.

UnifiedViewDTO

class UnifiedViewDTO(BaseModel):
    content: ViewResultDTO | None = None
    menu: ViewResultDTO | None = None
    clean_history: bool = False
    alert_text: str | None = None
    chat_id: int | str | None = None
    session_key: int | str | None = None
    mode: str | None = None
    message_thread_id: int | None = None
    model_config = ConfigDict(arbitrary_types_allowed=True)

A comprehensive DTO representing the full response from an orchestrator. It can contain data for multiple messages (content and menu), control flags, and routing information.

class MenuViewDTO(BaseModel):
    text: str
    keyboard: InlineKeyboardMarkup | None = None
    model_config = ConfigDict(arbitrary_types_allowed=True)

A universal DTO for passing ready-to-use UI (text + keyboard) from the service layer to handlers. This is similar to ViewResultDTO but might be used in slightly different contexts within the application flow.