From ef760c616b344f95ff878c74693fd3454c4831b8 Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Tue, 14 Jul 2026 13:09:12 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Frage=204=20(Catch-All=20Ja/Nein)=20mit?= =?UTF-8?q?=20Buttons=20=E2=9C=85=E2=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Buttons bei Frage 4 für Nicht-DM-Räume - Button-Klick (ONBOARD:::✅ Ja) wird erkannt - Text-Eingabe (ja/nein) weiterhin als Fallback --- plugin/adapter.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/plugin/adapter.py b/plugin/adapter.py index 90a1a9d..d1f4af5 100644 --- a/plugin/adapter.py +++ b/plugin/adapter.py @@ -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:::✅ 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,7 +2401,21 @@ class RocketChatAdapter(BasePlatformAdapter): text = questions.get(current_q, "") 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: """Gehe zum nächsten fehlenden Raum oder schließe Onboarding ab."""