domovoy_bot/keyboards/reply.py

40 lines
1.2 KiB
Python

"""
Reply-клавиатуры (кнопки под строкой ввода)
"""
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
from aiogram.utils.keyboard import ReplyKeyboardBuilder
def get_reply_menu() -> ReplyKeyboardMarkup:
"""
Reply-меню для жильцов
Используется редко, в основном для важных действий
"""
builder = ReplyKeyboardBuilder()
builder.row(
KeyboardButton(text='📞 Телефоны'),
KeyboardButton(text='👷 Мастера'),
)
builder.row(
KeyboardButton(text='❓ Помощь'),
)
# Resize keyboard чтобы не занимал много места
return builder.as_markup(resize_keyboard=True, one_time_keyboard=False)
def get_admin_reply_menu() -> ReplyKeyboardMarkup:
"""Reply-меню для админа"""
builder = ReplyKeyboardBuilder()
builder.row(
KeyboardButton(text='/admin'),
KeyboardButton(text='/stats'),
)
builder.row(
KeyboardButton(text='/spies'),
KeyboardButton(text='/export'),
)
return builder.as_markup(resize_keyboard=True)