diff --git a/matrixbot/commands.py b/matrixbot/commands.py index 7ea62ea..6f408f4 100644 --- a/matrixbot/commands.py +++ b/matrixbot/commands.py @@ -2823,7 +2823,10 @@ async def _answer_20q(thing: str, category: str, question: str) -> str: ) as response: data = await response.json() raw = data.get("message", {}).get("content", "").strip() - # Hard cap at 6 words — enough for a real answer, not enough to name-drop + # Take the first sentence; fall back to a 6-word hard cap + m = re.search(r"^[^.!?\n]+[.!?]", raw) + if m and len(m.group(0).split()) <= 10: + return m.group(0).strip() words = raw.split() return " ".join(words[:6]) if words else "..." except Exception as e: