feat: add subscribtion scheduler with ai, pagination

This commit is contained in:
Faynot
2026-03-29 11:25:31 +03:00
parent 1db524f757
commit 164acd6307
16 changed files with 688 additions and 358 deletions

41
keyboards.py Normal file
View File

@@ -0,0 +1,41 @@
from aiogram.types import InlineKeyboardButton
from aiogram.utils.keyboard import InlineKeyboardBuilder
def get_start_kb():
builder = InlineKeyboardBuilder()
builder.row(InlineKeyboardButton(text="✅ Подписаться", callback_data="subscribe"))
builder.row(InlineKeyboardButton(text="📄 Читать оферту", url="https://telegra.ph/..."))
return builder.as_markup()
def get_profile_edit_kb():
builder = InlineKeyboardBuilder()
builder.row(InlineKeyboardButton(text="📝 Редактировать профиль", callback_data="subscribe"))
return builder.as_markup()
def get_spheres_kb():
builder = InlineKeyboardBuilder()
spheres = ["Backend", "Frontend", "Mobile", "DevOps", "Design", "QA"]
for sphere in spheres:
builder.add(InlineKeyboardButton(text=sphere, callback_data=f"sphere_{sphere}"))
builder.row(InlineKeyboardButton(text="⌨️ Свой вариант", callback_data="sphere_other"))
builder.adjust(2)
return builder.as_markup()
def get_skip_kb():
builder = InlineKeyboardBuilder()
builder.row(InlineKeyboardButton(text="⏩ Пропустить", callback_data="skip_preferences"))
return builder.as_markup()
def get_pagination_kb(page: int):
builder = InlineKeyboardBuilder()
buttons = []
if page > 1:
buttons.append(InlineKeyboardButton(text="⬅️ Назад", callback_data=f"browse_{page-1}"))
buttons.append(InlineKeyboardButton(text=f"📄 Стр. {page}", callback_data="ignore"))
buttons.append(InlineKeyboardButton(text="Вперед ➡️", callback_data=f"browse_{page+1}"))
builder.row(*buttons)
return builder.as_markup()