fix: enhance insufficient funds message and update subscription controls logic

This commit is contained in:
2026-05-03 07:03:53 +07:00
parent ac61cec78c
commit e9f84d9377
5 changed files with 18 additions and 76 deletions

View File

@@ -54,18 +54,19 @@ deposit_kb: InlineKeyboardMarkup = InlineKeyboardBuilder(
).as_markup()
def subscription_controls(current_autorenewal_status: bool) -> InlineKeyboardMarkup:
autorenewal_text = (
"🟢 Включить автопродление"
if not current_autorenewal_status
else "🔴 Отключить автопродление"
)
return InlineKeyboardBuilder(
[
[InlineKeyboardButton(text=autorenewal_text, callback_data="toggle:autorenewal")],
[_return_to_menu_btn],
]
).as_markup()
def subscription_controls(show_autorenew: bool, current_autorenewal_status: bool = None) -> InlineKeyboardMarkup:
builder = InlineKeyboardBuilder()
if show_autorenew:
autorenewal_text = (
"🟢 Включить автопродление"
if not current_autorenewal_status
else "🔴 Отключить автопродление"
)
builder.row(InlineKeyboardButton(text=autorenewal_text, callback_data="toggle:autorenewal"))
builder.row(_return_to_menu_btn)
return builder.as_markup()
def _return_btn(data: str = "menu:main", text: str = "⬅️ Назад") -> InlineKeyboardButton: