Files
FascioSchoolBot/app/bot/dialogs/flows/profile/dialogs.py
2025-09-27 09:13:20 +03:00

42 lines
1.3 KiB
Python

from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.input import TextInput
from aiogram_dialog.widgets.kbd import Cancel, SwitchTo
from aiogram_dialog.widgets.text import Const, Format
from app.bot.dialogs.widgets.getters import user_getter
from .states import ProfileSG
profile_dialog = Dialog(
Window(
Const("*Профиль*"),
Format("Имя: {user.fullname}"),
Format("Телефон: {user.phone}"),
SwitchTo(
Const("изменить имя"),
id="change_name",
state=ProfileSG.change_name,
),
SwitchTo(
Const("изменить телефон"),
id="change_phone",
state=ProfileSG.change_phone,
),
Cancel(Const("назад")),
state=ProfileSG.profile,
getter=user_getter,
),
Window(
Const("Введите имя"),
SwitchTo(Const("отмена"), id="go_profile", state=ProfileSG.profile),
TextInput(id="name_input"),
state=ProfileSG.change_name,
),
Window(
Const("Введите телефон"),
SwitchTo(Const("отмена"), id="go_profile", state=ProfileSG.profile),
TextInput(id="phone_input"),
state=ProfileSG.change_phone,
),
)