add dialog for events_list
This commit is contained in:
23
app/bot/dialogs/flows/events/dialogs.py
Normal file
23
app/bot/dialogs/flows/events/dialogs.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from aiogram_dialog import Dialog, Window
|
||||
from aiogram_dialog.widgets.kbd import Column, Select
|
||||
from aiogram_dialog.widgets.text import Const, Format
|
||||
|
||||
from .getters import events_getter
|
||||
from .states import EventsSG
|
||||
|
||||
events_dialog = Dialog(
|
||||
Window(
|
||||
Const("События"),
|
||||
Column(
|
||||
Select(
|
||||
Format("{item}"),
|
||||
id="categ",
|
||||
item_id_getter=lambda x: x,
|
||||
items="events",
|
||||
)
|
||||
),
|
||||
getter=events_getter,
|
||||
state=EventsSG.events_list,
|
||||
),
|
||||
# Window(state=EventsSG.event),
|
||||
)
|
||||
6
app/bot/dialogs/flows/events/getters.py
Normal file
6
app/bot/dialogs/flows/events/getters.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from aiogram.types import User
|
||||
from aiogram_dialog import DialogManager
|
||||
|
||||
|
||||
async def events_getter(dialog_manager: DialogManager, event_from_user: User, **kwargs) -> dict[str, str]:
|
||||
return {"events": ["ev1", "ev2", "ev3"]}
|
||||
6
app/bot/dialogs/flows/events/states.py
Normal file
6
app/bot/dialogs/flows/events/states.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from aiogram.fsm.state import State, StatesGroup
|
||||
|
||||
|
||||
class EventsSG(StatesGroup):
|
||||
events_list = State()
|
||||
event = State()
|
||||
Reference in New Issue
Block a user