mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-02-22 20:31:47 +00:00
- Add pyproject.toml with uv and ruff configuration - Pin Python version to 3.13 via .python-version - Add Makefile commands: lint, format, fix - Apply ruff formatting to entire codebase - Remove unused imports (base64 in yookassa/simple_subscription) - Update .gitignore for new config files
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
"""Контекст меню для построения кнопок."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Any
|
|
|
|
from aiogram.types import InlineKeyboardButton
|
|
|
|
|
|
@dataclass
|
|
class MenuContext:
|
|
"""Контекст пользователя для построения меню."""
|
|
|
|
language: str = 'ru'
|
|
is_admin: bool = False
|
|
is_moderator: bool = False
|
|
has_active_subscription: bool = False
|
|
subscription_is_active: bool = False
|
|
has_had_paid_subscription: bool = False
|
|
balance_kopeks: int = 0
|
|
subscription: Any | None = None
|
|
show_resume_checkout: bool = False
|
|
has_saved_cart: bool = False
|
|
custom_buttons: list[InlineKeyboardButton] = field(default_factory=list)
|
|
# Расширенные поля для плейсхолдеров и условий
|
|
username: str = ''
|
|
subscription_days: int = 0
|
|
traffic_used_gb: float = 0.0
|
|
traffic_left_gb: float = 0.0
|
|
referral_count: int = 0
|
|
referral_earnings_kopeks: int = 0
|
|
registration_days: int = 0
|
|
promo_group_id: str | None = None
|
|
has_autopay: bool = False
|