Files
queuebot/bot/app/keyboards.py
ollyhearn e315648bc5 a
2023-06-08 20:33:05 +03:00

49 lines
1.6 KiB
Python
Raw 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.

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 telebot.types import (
InlineKeyboardButton as button,
InlineKeyboardMarkup as keyboard,
)
from db.models import Queue
def menu() -> keyboard:
return keyboard(
keyboard=[
[button(text=" Новая очередь", callback_data="new_queue")],
[button(text="📋 Мои очереди", callback_data="my_queues")],
[button(text="🔧 Настройки", callback_data="settings")],
[button(text=" О боте", callback_data="about")],
]
)
def my_queues(queues: list[Queue]) -> keyboard:
kb = [[button(text=q.name, callback_data=f"q:{q.id}")] for q in queues]
kb.append([button(text="⬅️ В меню", callback_data="to_menu")])
return keyboard(kb)
def queue_menu() -> keyboard:
return keyboard(
keyboard=[
[button(text="✏️ Изменить название", callback_data="edit_queue_name")],
[button(text="🫂 Список участников", callback_data="participants")],
[button(text="❌ Удалить очередь", callback_data="delete_queue")],
[button(text="⬅️ В меню", callback_data="to_menu")],
]
)
def settings() -> keyboard:
return keyboard(
keyboard=[
[button(text="✏️ Поменять свое имя", callback_data="edit_name")],
[button(text="⬅️ В меню", callback_data="to_menu")],
]
)
def edit_name() -> keyboard:
return keyboard(
keyboard=[
[button(text="❌ Отмена", callback_data="settings")],
]
)