fix comand

This commit is contained in:
Yuriy Yuriev
2026-05-22 23:06:31 +07:00
parent 22b49109fa
commit e2e2761b51
2 changed files with 14 additions and 7 deletions
+10 -7
View File
@@ -2952,18 +2952,21 @@ class BotInterface:
cost = int(value * settings.CLICK_PRICE_RUB)
# Сохраняем для шага подтверждения
self._payment_confirm[user_id] = {"clicks": value, "rub": cost}
rub_bal = await self.rub_storage.get_balance(user_id)
builder = InlineKeyboardBuilder()
builder.row(
InlineKeyboardButton(text="✅ Подтвердить", callback_data="confirm_buy"),
InlineKeyboardButton(text="❌ Отмена", callback_data="cancel_confirm_buy"),
)
if rub_bal >= cost:
builder.row(InlineKeyboardButton(
text=f"💰 С баланса ({rub_bal} ₽)",
callback_data="pay_from_balance"
))
builder.row(InlineKeyboardButton(text="💳 Оплатить криптой", callback_data="confirm_buy"))
builder.row(InlineKeyboardButton(text="❌ Отмена", callback_data="cancel_confirm_buy"))
await _edit_prompt(
f"🛒 Подтвердите покупку\n\n"
f"🔢 {value} переходов\n"
f"💰 Стоимость: {cost}",
f"🔢 {value} переходов × {fmt_price(settings.CLICK_PRICE_RUB)} ₽ = {cost}"
+ (f"\n\n🪙 Ваш баланс: {rub_bal}" if rub_bal > 0 else ""),
builder.as_markup()
)