feat: add clickable points activity menu
This commit is contained in:
1 parent
b21ceda9df
commit
67d505f4f2
4 files changed
+33
-3
No files matched your search
+11
-3
@@ -956,6 +956,7 @@ class BelkiBot:
|
||||
return {
|
||||
"menu:lu": "/лу", "menu:zu": "/зу", "menu:training": "/урок",
|
||||
"menu:inspection": "/осмотр", "menu:goal": "/цель", "menu:help": "/help", "menu:cancel": "/отмена", "menu:application": "/заявка",
|
||||
"points:coaching": "прокачка", "points:training": "тренировка", "points:inspection": "осмотр",
|
||||
"application:feathers": "/перо", "application:kitten": "/бельчонок",
|
||||
"application:flying": "/летяга", "application:curator": "/куратор",
|
||||
"application:skip-vk": "нет", "application:practice-yes": "да", "application:practice-no": "нет",
|
||||
@@ -1188,6 +1189,13 @@ class BelkiDialog:
|
||||
[self._button("Отмена", "menu:cancel", "negative")]],
|
||||
}
|
||||
return {"one_time": False, "buttons": [[self._button("Отмена", "menu:cancel", "negative")]]}
|
||||
if state and state.get("mode") == "points_choice":
|
||||
return {"one_time": True, "buttons": [
|
||||
[self._button("Прокачка", "points:coaching", "primary")],
|
||||
[self._button("Тренировка", "points:training", "secondary")],
|
||||
[self._button("Осмотр", "points:inspection", "secondary")],
|
||||
[self._button("Отмена", "menu:cancel", "negative")],
|
||||
]}
|
||||
if state and state.get("mode") == "inspection":
|
||||
next_key = next((key for key, _ in self._ORDERS["inspection"] if not self._has_field(state, key)), None)
|
||||
if next_key == "place":
|
||||
@@ -1475,12 +1483,12 @@ class BelkiDialog:
|
||||
"""
|
||||
key = next((key for key, _ in self._ORDERS[state["mode"]] if not self._has_field(state, key)), None)
|
||||
if state["mode"] == "points_choice" and key == "activity":
|
||||
activity = text.lower()
|
||||
if activity in ("прокачка", "лу", "зу"):
|
||||
activity = text.strip().lower()
|
||||
if activity in ("прокачка", "прокачку", "лу", "зу"):
|
||||
state["mode"] = "points_coaching"
|
||||
if activity in ("лу", "зу"):
|
||||
state["skill"] = activity.upper()
|
||||
elif activity in ("тренировка", "урок"):
|
||||
elif activity in ("тренировка", "тренировку", "урок"):
|
||||
state["mode"] = "points_training"
|
||||
elif activity in ("осмотр", "осмотры"):
|
||||
state["mode"] = "points_inspection"
|
||||
|
||||
Reference in new issue
Block a user