love-bot/bot/keyboards/game_keyboard.py

28 lines
979 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.filters.callback_data import CallbackData
class GameChoiceCallback(CallbackData, prefix="game"):
choice: str
def get_game_choice_keyboard() -> InlineKeyboardMarkup:
"""Возвращает инлайн-клавиатуру с кнопками выбора хода."""
buttons = [
[
InlineKeyboardButton(
text="🗿 Камень",
callback_data=GameChoiceCallback(choice="rock").pack()
),
InlineKeyboardButton(
text="✂️ Ножницы",
callback_data=GameChoiceCallback(choice="scissors").pack()
),
InlineKeyboardButton(
text="📄 Бумага",
callback_data=GameChoiceCallback(choice="paper").pack()
)
]
]
keyboard = InlineKeyboardMarkup(inline_keyboard=buttons)
return keyboard