Skip to content

Commit

Permalink
added add hint parts
Browse files Browse the repository at this point in the history
  • Loading branch information
bomzheg committed Oct 6, 2024
1 parent 7a64c80 commit 5fb39d6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions shvatka/tgbot/dialogs/time_hint/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
width=2,
height=10,
),
SwitchTo(
Const("Добавить"),
state=states.TimeHintEditSG.add_part,
id="to_add_part"
),
Button(
text=Const("Сохранить изменения"),
id="save_time_hint",
Expand All @@ -120,5 +125,26 @@
getter=get_hints,
state=states.TimeHintEditSG.time,
),
Window(
Jinja("Подсказка выходящая в {{time}} мин."),
Case(
{
False: Const("Присылай сообщения с подсказками (текст, фото, видео итд)"),
True: Jinja(
"{{hints | hints}}\n"
"Можно прислать ещё сообщения или вернуться"
),
},
selector="has_hints",
),
MessageInput(func=process_hint),
SwitchTo(
text=Const("Вернуться"),
state=states.TimeHintEditSG.details,
id="to_details",
),
getter=get_hints,
state=states.TimeHintEditSG.add_part,
),
on_start=hint_edit_on_start,
)
1 change: 1 addition & 0 deletions shvatka/tgbot/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TimeHintSG(StatesGroup):
class TimeHintEditSG(StatesGroup):
details = State()
time = State()
add_part = State()


class LevelListSG(StatesGroup):
Expand Down

0 comments on commit 5fb39d6

Please sign in to comment.