This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
l9_stud_bot/tg/keyboards.py

33 lines
984 B
Python

from telegram import (
InlineKeyboardMarkup,
InlineKeyboardButton,
ReplyKeyboardMarkup,
KeyboardButton,
)
class Keyboard:
def confirm() -> InlineKeyboardMarkup:
"""Клавиатура Да/Нет"""
buttons = [
[
InlineKeyboardButton("Да", callback_data="yes"),
InlineKeyboardButton("Нет", callback_data="no"),
]
]
return InlineKeyboardMarkup(buttons)
def cancel() -> ReplyKeyboardMarkup:
"""Кнопка отмены"""
buttons = [[KeyboardButton("Отмена")]]
return ReplyKeyboardMarkup(
buttons, resize_keyboard=True, one_time_keyboard=True
)
def menu() -> ReplyKeyboardMarkup:
"""Кнопка Главного меню"""
buttons = [[KeyboardButton("Главное меню")]]
return ReplyKeyboardMarkup(
buttons, resize_keyboard=True, one_time_keyboard=True
)