fix: Frage 4 (Catch-All Ja/Nein) mit Buttons ✅❌
- Buttons bei Frage 4 für Nicht-DM-Räume
- Button-Klick (ONBOARD:<rid>::✅ Ja) wird erkannt
- Text-Eingabe (ja/nein) weiterhin als Fallback
This commit is contained in:
+23
-3
@@ -2323,8 +2323,14 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
|
|
||||||
# Frage 4: catch_all
|
# Frage 4: catch_all
|
||||||
if current_q == 4:
|
if current_q == 4:
|
||||||
answer = text.strip().lower()
|
raw = text.strip()
|
||||||
is_catch_all = answer in ("ja", "yes", "j", "y", "1", "👍", "✅")
|
# Button-Klick erkennen: ONBOARD:<rid>::✅ Ja / ❌ Nein
|
||||||
|
if raw.startswith("ONBOARD:"):
|
||||||
|
button_label = raw.split("::", 1)[1] if "::" in raw else ""
|
||||||
|
answer = button_label.lower()
|
||||||
|
else:
|
||||||
|
answer = raw.lower()
|
||||||
|
is_catch_all = answer in ("ja", "yes", "j", "y", "1", "👍", "✅") or "✅" in answer or "ja" in answer
|
||||||
data["catch_all"] = is_catch_all
|
data["catch_all"] = is_catch_all
|
||||||
|
|
||||||
# Raum zur Map hinzufügen
|
# Raum zur Map hinzufügen
|
||||||
@@ -2395,7 +2401,21 @@ class RocketChatAdapter(BasePlatformAdapter):
|
|||||||
|
|
||||||
text = questions.get(current_q, "")
|
text = questions.get(current_q, "")
|
||||||
if text:
|
if text:
|
||||||
await self._post_message_with_retry(operator_room_id, text)
|
# Frage 4 (Catch-All Ja/Nein): mit Buttons senden
|
||||||
|
if current_q == 4 and not is_dm:
|
||||||
|
_build = self._get_build_custom_buttons()
|
||||||
|
buttons = _build(
|
||||||
|
["✅ Ja", "❌ Nein"],
|
||||||
|
prefix=f"ONBOARD:{state['missing_rooms'][state['current_room_index']]['room_id']}"
|
||||||
|
)
|
||||||
|
attachments = [{
|
||||||
|
"color": "#1d74f5",
|
||||||
|
"title": "Catch-All für diesen Raum?",
|
||||||
|
"actions": buttons,
|
||||||
|
}]
|
||||||
|
await self._post_message_with_retry(operator_room_id, text, attachments=attachments)
|
||||||
|
else:
|
||||||
|
await self._post_message_with_retry(operator_room_id, text)
|
||||||
|
|
||||||
async def _onboarding_next_room(self) -> None:
|
async def _onboarding_next_room(self) -> None:
|
||||||
"""Gehe zum nächsten fehlenden Raum oder schließe Onboarding ab."""
|
"""Gehe zum nächsten fehlenden Raum oder schließe Onboarding ab."""
|
||||||
|
|||||||
Reference in New Issue
Block a user