39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
|
|
|
from config import SHOP_CHANNEL
|
|
|
|
|
|
def main_menu_kb() -> InlineKeyboardMarkup:
|
|
return InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[
|
|
InlineKeyboardButton(text="👤 Профиль", callback_data="profile"),
|
|
InlineKeyboardButton(text="📈 Статистика", callback_data="stats"),
|
|
],
|
|
[
|
|
InlineKeyboardButton(text="💰 Курсы", callback_data="rates"),
|
|
InlineKeyboardButton(text="💳 Вывод", callback_data="withdraw"),
|
|
],
|
|
[InlineKeyboardButton(text="📢 Канал", url=SHOP_CHANNEL)],
|
|
]
|
|
)
|
|
|
|
|
|
def activate_kb(url: str, amount: float) -> InlineKeyboardMarkup:
|
|
if not url:
|
|
return back_kb()
|
|
|
|
return InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[InlineKeyboardButton(text=f"Получить {amount:.2f} ₽", url=url)]
|
|
]
|
|
)
|
|
|
|
|
|
def back_kb(callback_data: str = "back_main") -> InlineKeyboardMarkup:
|
|
return InlineKeyboardMarkup(
|
|
inline_keyboard=[
|
|
[InlineKeyboardButton(text="🔙 Назад", callback_data=callback_data)]
|
|
]
|
|
)
|