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:
+22
-2
@@ -2323,8 +2323,14 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
|
||||
# Frage 4: catch_all
|
||||
if current_q == 4:
|
||||
answer = text.strip().lower()
|
||||
is_catch_all = answer in ("ja", "yes", "j", "y", "1", "👍", "✅")
|
||||
raw = text.strip()
|
||||
# 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
|
||||
|
||||
# Raum zur Map hinzufügen
|
||||
@@ -2395,6 +2401,20 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
|
||||
text = questions.get(current_q, "")
|
||||
if 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:
|
||||
|
||||
Reference in New Issue
Block a user