Files
2024-12-23 22:03:04 +07:00

33 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# BotCode/keyboards/reply_kb/help_kb.py
# Создание клавиатуры для сообщения: "Помогите!"
from aiogram import Router, F
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
from aiogram.utils.keyboard import ReplyKeyboardBuilder
# Создание роутера и настройка экспорта модулей
__all__ = ("router", "get_help_kb", "kb_text",)
kb_text = "HelpKb"
router = Router(name="help_kb_router")
# Функция создания клавиатуры на сообщение: "Помогите!"
@router.message(F.text.lower() == "помогите!")
def get_help_kb() -> ReplyKeyboardMarkup:
numbers = [
"1", "2", "3",
"4", "5", "6",
"7", "8", "9",
"0",
]
buttons_row = [KeyboardButton(text=num) for num in numbers]
builder = ReplyKeyboardBuilder()
for num in numbers:
builder.button(text=num)
builder.adjust(3)
builder.row(buttons_row[3], buttons_row[9])
builder.add(buttons_row[-1])
return builder.as_markup(resize_keyboard=True)