151 lines
5.2 KiB
Python
151 lines
5.2 KiB
Python
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
|
from locales import localization
|
|
|
|
|
|
class Keyboards:
|
|
"""Класс для создания клавиатур"""
|
|
|
|
@staticmethod
|
|
def get_main_keyboard(locale: str = "ru") -> InlineKeyboardMarkup:
|
|
"""Основная клавиатура бота"""
|
|
keyboard = InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.buy_subscription", locale),
|
|
callback_data="buy_subscription"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.support", locale),
|
|
callback_data="support"
|
|
),
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.rules", locale),
|
|
callback_data="rules"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.language", locale),
|
|
callback_data="language"
|
|
)
|
|
]
|
|
]
|
|
)
|
|
|
|
return keyboard
|
|
|
|
@staticmethod
|
|
def get_buy_subscription_keyboard(locale: str = "ru") -> InlineKeyboardMarkup:
|
|
"""Клавиатура для покупки подписки"""
|
|
keyboard = InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("tariffs.14_days", locale),
|
|
callback_data="buy_14_days"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("tariffs.30_days", locale),
|
|
callback_data="buy_30_days"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("tariffs.60_days", locale),
|
|
callback_data="buy_60_days"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("tariffs.90_days", locale),
|
|
callback_data="buy_90_days"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("tariffs.180_days", locale),
|
|
callback_data="buy_180_days"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("tariffs.360_days", locale),
|
|
callback_data="buy_360_days"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.back", locale),
|
|
callback_data="back_to_main"
|
|
)
|
|
]
|
|
]
|
|
)
|
|
|
|
return keyboard
|
|
|
|
@staticmethod
|
|
def get_language_keyboard(locale: str = "ru") -> InlineKeyboardMarkup:
|
|
"""Клавиатура выбора языка"""
|
|
keyboard = InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("languages.ru", locale),
|
|
callback_data="lang_ru"
|
|
),
|
|
InlineKeyboardButton(
|
|
text=localization.get("languages.en", locale),
|
|
callback_data="lang_en"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("languages.kz", locale),
|
|
callback_data="lang_kz"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.back", locale),
|
|
callback_data="back_to_main"
|
|
)
|
|
]
|
|
]
|
|
)
|
|
|
|
return keyboard
|
|
|
|
@staticmethod
|
|
def get_support_keyboard(locale: str = "ru") -> InlineKeyboardMarkup:
|
|
"""Клавиатура техподдержки"""
|
|
keyboard = InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[
|
|
InlineKeyboardButton(
|
|
text="📝 Создать тикет",
|
|
callback_data="support_create_ticket"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text="📋 Мои тикеты",
|
|
callback_data="support_my_tickets"
|
|
)
|
|
],
|
|
[
|
|
InlineKeyboardButton(
|
|
text=localization.get("buttons.back", locale),
|
|
callback_data="back_to_main"
|
|
)
|
|
]
|
|
]
|
|
)
|
|
|
|
return keyboard
|