merge user, admin and common dialogs to one folder
This commit is contained in:
38
app/bot/dialogs/flows/profile/dialogs.py
Normal file
38
app/bot/dialogs/flows/profile/dialogs.py
Normal file
@@ -0,0 +1,38 @@
|
||||
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 .states import ProfileSG
|
||||
|
||||
profile_dialog = Dialog(
|
||||
Window(
|
||||
Const("*Профиль*"),
|
||||
Format("Имя:"),
|
||||
Format("Телефон:"),
|
||||
SwitchTo(
|
||||
Const("изменить имя"),
|
||||
id="change_name",
|
||||
state=ProfileSG.change_name,
|
||||
),
|
||||
SwitchTo(
|
||||
Const("изменить телефон"),
|
||||
id="change_phone",
|
||||
state=ProfileSG.change_phone,
|
||||
),
|
||||
Cancel(Const("назад")),
|
||||
state=ProfileSG.profile,
|
||||
),
|
||||
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,
|
||||
),
|
||||
)
|
||||
9
app/bot/dialogs/flows/profile/states.py
Normal file
9
app/bot/dialogs/flows/profile/states.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from aiogram.fsm.state import State, StatesGroup
|
||||
|
||||
|
||||
class ProfileSG(StatesGroup):
|
||||
profile = State()
|
||||
change_name = State()
|
||||
input_name = State()
|
||||
change_phone = State()
|
||||
change_phone = State()
|
||||
Reference in New Issue
Block a user