mirror of
https://github.com/koloideal/Quizzi.git
synced 2026-06-10 10:25:28 +03:00
37 lines
1.6 KiB
Python
37 lines
1.6 KiB
Python
from aiogram.types import CallbackQuery
|
|
from aiogram_dialog import Dialog, DialogManager, Window, StartMode
|
|
from aiogram_dialog.widgets.kbd import Button, Column
|
|
from aiogram_dialog.widgets.text import Const
|
|
|
|
from trudex.application.bot.creator_dialogs.states import CreatorMenuSG, CreatorUsersSG, CreatorTestsSG, CreatorBroadcastSG, CreatorGroupsSG
|
|
|
|
|
|
async def on_tests_clicked(_callback: CallbackQuery, _button: Button, manager: DialogManager) -> None:
|
|
await manager.start(CreatorTestsSG.tests_list, mode=StartMode.RESET_STACK)
|
|
|
|
|
|
async def on_users_clicked(_callback: CallbackQuery, _button: Button, manager: DialogManager) -> None:
|
|
await manager.start(CreatorUsersSG.users_list, mode=StartMode.RESET_STACK)
|
|
|
|
|
|
async def on_groups_clicked(_callback: CallbackQuery, _button: Button, manager: DialogManager) -> None:
|
|
await manager.start(CreatorGroupsSG.groups_list, mode=StartMode.RESET_STACK)
|
|
|
|
|
|
async def on_broadcast_clicked(_callback: CallbackQuery, _button: Button, manager: DialogManager) -> None:
|
|
await manager.start(CreatorBroadcastSG.broadcast_input, mode=StartMode.RESET_STACK)
|
|
|
|
|
|
creator_menu_dialog = Dialog(
|
|
Window(
|
|
Const("👑 <b>Панель создателя</b>\n\nВыберите раздел:"),
|
|
Column(
|
|
Button(Const("📝 Тесты"), id="tests", on_click=on_tests_clicked),
|
|
Button(Const("👥 Пользователи"), id="users", on_click=on_users_clicked),
|
|
Button(Const("🎓 Группы"), id="groups", on_click=on_groups_clicked),
|
|
Button(Const("📢 Рассылка"), id="broadcast", on_click=on_broadcast_clicked),
|
|
),
|
|
state=CreatorMenuSG.main,
|
|
),
|
|
)
|