bot works as echo (adding templates s functional)

tpl_list dont
This commit is contained in:
2025-08-19 05:13:16 +09:00
parent a8d860ed87
commit 18a92ca526
7 changed files with 274 additions and 47 deletions

View File

@@ -10,7 +10,27 @@ def template_type_keyboard() -> InlineKeyboardMarkup:
def get_templates_keyboard(templates: List[Any], page: int = 0) -> InlineKeyboardMarkup:
"""Возвращает клавиатуру со списком шаблонов."""
return KbBuilder.get_templates_keyboard(templates, page)
keyboard = []
for template in templates:
keyboard.append([
InlineKeyboardButton(
template.name,
callback_data=f"template:{template.id}"
)
])
return InlineKeyboardMarkup(keyboard)
def get_preview_keyboard() -> InlineKeyboardMarkup:
"""Возвращает клавиатуру для предпросмотра."""
keyboard = [
[
InlineKeyboardButton("✅ Отправить", callback_data="preview:send"),
InlineKeyboardButton("❌ Отмена", callback_data="preview:cancel")
]
]
return InlineKeyboardMarkup(keyboard)
class KbBuilder: