486 lines
12 KiB
Python
486 lines
12 KiB
Python
from aiogram.types import InlineKeyboardButton
|
||
from aiogram.utils.keyboard import InlineKeyboardBuilder
|
||
from aiogram.utils.keyboard import InlineKeyboardBuilder, ReplyKeyboardBuilder
|
||
from aiogram.types import InlineKeyboardButton, KeyboardButton
|
||
|
||
|
||
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="👥 Реферальная программа",
|
||
callback_data="referral",
|
||
)
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="❔ FAQ ❔",
|
||
callback_data="faq",
|
||
)
|
||
)
|
||
# Оставляем URL как у Вовы, меняем только текст
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="ℹ️ О нас",
|
||
url="https://www.youtube.com/watch?v=Zirn-CKck-c",
|
||
)
|
||
)
|
||
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 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():
|
||
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():
|
||
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():
|
||
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}",
|
||
),
|
||
InlineKeyboardButton(
|
||
text="🔁 Продлить",
|
||
callback_data=f"sub_renew:{sub_id}",
|
||
),
|
||
)
|
||
builder.row(
|
||
InlineKeyboardButton(
|
||
text="➕ Новая",
|
||
callback_data="buy_subscription",
|
||
)
|
||
)
|
||
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 tarif_Lark_keyboard():
|
||
"""
|
||
Тариф Lark (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 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, amount, classif):
|
||
"""
|
||
Подтверждение покупки тарифа
|
||
"""
|
||
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()
|