Initial commit
This commit is contained in:
12
menus/engine.py
Normal file
12
menus/engine.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from menus.menu_config import MENUS
|
||||
from keyboards.factory import build_keyboard
|
||||
|
||||
async def show_menu(message, menu_name: str):
|
||||
menu = MENUS.get(menu_name)
|
||||
|
||||
if not menu:
|
||||
await message.answer("Меню не найдено.")
|
||||
return
|
||||
|
||||
keyboard = build_keyboard(menu["buttons"])
|
||||
await message.answer(menu["text"], keyboard=keyboard)
|
||||
Reference in New Issue
Block a user