Files
2025-02-08 19:12:38 +07:00

31 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 BotLibrary import rkb
# Создание роутера и настройка экспорта модулей
__all__ = ("router", "get_help_kb")
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]
for num in numbers:
rkb.button(text=num)
rkb.adjust(3)
return rkb.as_markup(resize_keyboard=True)