448 lines
10 KiB
Python
448 lines
10 KiB
Python
from aiogram.utils.keyboard import InlineKeyboardBuilder, ReplyKeyboardBuilder
|
||
from aiogram.types import InlineKeyboardButton, KeyboardButton
|
||
|
||
|
||
def main_keyboard():
|
||
"""
|
||
Главное меню
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="📜 Профиль",
|
||
callback_data="profile",
|
||
)
|
||
)
|
||
# ------
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="❔ FAQ ❔",
|
||
callback_data="faq",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="ℹ️ О нас",
|
||
url="https://www.youtube.com/watch?v=Zirn-CKck-c",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def account_keyboard():
|
||
"""
|
||
Клавиатура профиля:
|
||
пополнить баланс, история транзакций, назад в главное меню.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🪙 Пополнить баланс",
|
||
callback_data="balance",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🧾 История транзакций",
|
||
callback_data="tranhist",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="base",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def balance_keyboard():
|
||
"""
|
||
Экран баланса
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🪙 Пополнить баланс",
|
||
callback_data="popup",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🧾 История транзакций",
|
||
callback_data="tranhist",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="profile",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def popup_keyboard():
|
||
"""
|
||
Суммы пополнения: 200, 300, 600, 1000 ₽.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(text="200 ₽", callback_data="popup:200"),
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(text="300 ₽", callback_data="popup:300"),
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(text="600 ₽", callback_data="popup:600"),
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(text="1000 ₽", callback_data="popup:1000"),
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="profile", # назад в профиль
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def payment_methods_keyboard(amount: int):
|
||
"""
|
||
Способы оплаты для выбранной суммы.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="⭐ Telegram Stars",
|
||
callback_data=f"method_stars_{amount}",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="💵 СБП",
|
||
callback_data=f"method_ykassa_{amount}",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🪙 CryptoBot",
|
||
callback_data=f"method_crypto_{amount}",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="popup",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def ticket_list_keyboard(tickets):
|
||
builder = InlineKeyboardBuilder()
|
||
for ticket in tickets:
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text=f"Тикет: {ticket['subject']}",
|
||
callback_data=f"ticket_{ticket['id']}",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="main_sup",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def sup_keyboard():
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="📝 Создать запрос",
|
||
callback_data="make_ticket",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="📂 Мои запросы",
|
||
callback_data="my_tickets",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def ticket_keyboard():
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Отмена",
|
||
callback_data="cancel",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def buy_keyboard():
|
||
"""
|
||
Меню выбора тарифа.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🐣 Lark Basic",
|
||
callback_data="subs",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🦅 Lark Pro",
|
||
callback_data="subs_pro",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="👨👩👧 Lark Family",
|
||
callback_data="subs_family",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="profile",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def tarif_Lark_keyboard():
|
||
"""
|
||
Тариф Lark Basic (Standart)
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🐣 Lark 1 месяц",
|
||
callback_data="Lark:Standart:1",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🐣 Lark 6 месяцев",
|
||
callback_data="Lark:Standart:6",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🐣 Lark 12 месяцев",
|
||
callback_data="Lark:Standart:12",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="buy_subscription",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def tarif_Lark_pro_keyboard():
|
||
"""
|
||
Тариф Lark Pro
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🦅 Lark Pro 1 месяц",
|
||
callback_data="Lark:Pro:1",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🦅 Lark Pro 6 месяцев",
|
||
callback_data="Lark:Pro:6",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🦅 Lark Pro 12 месяцев",
|
||
callback_data="Lark:Pro:12",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="buy_subscription",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def tarif_Lark_family_keyboard():
|
||
"""
|
||
Тариф Lark Family.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="👨👩👧 Lark Family 1 месяц",
|
||
callback_data="Lark:Family:1",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="👨👩👧 Lark Family 6 месяцев",
|
||
callback_data="Lark:Family:6",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="👨👩👧 Lark Family 12 месяцев",
|
||
callback_data="Lark:Family:12",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="buy_subscription",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def subscriptions_card_keyboard(sub_id: str, index: int, total: int):
|
||
"""
|
||
Карточка подписки:
|
||
навигация, конфиг, назад в главное меню.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
|
||
# Навигация по подпискам
|
||
nav = []
|
||
if index > 0:
|
||
nav.append(
|
||
InlineKeyboardButton(
|
||
text="⬅️",
|
||
callback_data=f"sub_prev:{index-1}",
|
||
)
|
||
)
|
||
if index < total - 1:
|
||
nav.append(
|
||
InlineKeyboardButton(
|
||
text="➡️",
|
||
callback_data=f"sub_next:{index+1}",
|
||
)
|
||
)
|
||
if nav:
|
||
builder.row(*nav)
|
||
|
||
# Конфиг
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔑 Конфиг",
|
||
callback_data=f"sub_cfg:{sub_id}",
|
||
)
|
||
)
|
||
|
||
# Назад в главное меню
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="base", # было "profile" изменил
|
||
)
|
||
)
|
||
|
||
return builder.as_markup()
|
||
|
||
|
||
def guide_keyboard():
|
||
"""
|
||
Руководство по подключению
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="📱 iOS / Android",
|
||
callback_data="mob",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="💻 Windows / macOS",
|
||
callback_data="pc",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="profile",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def faq_keyboard():
|
||
"""
|
||
FAQ
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="base",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def tranhist_keyboard():
|
||
"""
|
||
История транзакций
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Назад",
|
||
callback_data="profile",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def tarif_confirm_keyboard(name: str, amount: int, classif: str):
|
||
"""
|
||
Подтверждение покупки тарифа
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="✅ Подтвердить",
|
||
callback_data=f"confirm:{name}_{classif}_{amount}",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="🔙 Отменить",
|
||
callback_data="buy_subscription",
|
||
)
|
||
)
|
||
return builder.as_markup()
|
||
|
||
|
||
def confirm_popup_keyboard():
|
||
"""
|
||
Подтверждение пополнения.
|
||
"""
|
||
builder = InlineKeyboardBuilder()
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="✅ Готово, вернуться в профиль",
|
||
callback_data="profile",
|
||
)
|
||
)
|
||
return builder.as_markup()
|