From 3405ab8b3284e2d6f4be392cac3d145e7eb11006 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Wed, 22 Apr 2026 11:22:49 -0400 Subject: [PATCH] 8ball: add third-party branch for Jared asking about someone other than himself/Wynter When Jared asks about a @mentioned third party, give a neutral honest prediction instead of hijacking the answer to be about Jared. Co-Authored-By: Claude Sonnet 4.6 --- matrixbot/commands.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/matrixbot/commands.py b/matrixbot/commands.py index cd7c735..bfdbc5a 100644 --- a/matrixbot/commands.py +++ b/matrixbot/commands.py @@ -310,8 +310,10 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str): q_lower = question.lower() about_wynter = bool(re.search(r'\b(wynter|she|her|herself)\b', q_lower)) about_jared = bool(re.search(r'\b(jared|he|him|himself)\b', q_lower)) + # Detect third-party questions: mentions someone else via @ or a name other than jared/wynter + has_other_mention = bool(re.search(r'@\S+', q_lower)) and not about_wynter and not about_jared - is_jared_branch = (sender == JARED_ID and not about_wynter) + is_jared_branch = (sender == JARED_ID and not about_wynter and not has_other_mention) if sender == JARED_ID and about_wynter: # Jared asking about Wynter — mock her, side with Jared _answer_color = "#ef4444" @@ -348,8 +350,26 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str): "Jared already knew the answer. Wynter didn't.", "The signs were always pointing away from Wynter.", ]) + elif sender == JARED_ID and has_other_mention: + # Jared asking about a third party — give a straight prediction + _answer_color = "#f59e0b" + q_for_prompt = question + bio_context = "" + prompt = ( + "You are a magic 8-ball. Answer the question with a short, one-sentence prediction. " + "Be honest and direct — not biased toward any particular person. " + "Respond in normal sentence case. One sentence max. Give only your prediction, no questions back.\n\n" + f"Question: {q_for_prompt}" + ) + fallback = random.choice([ + "Signs point to yes.", + "Outlook uncertain.", + "Don't count on it.", + "Most likely.", + "Ask again later.", + ]) elif sender == JARED_ID: - # Jared asking about anything else — always positive about Jared + # Jared asking about himself or general — always positive about Jared _answer_color = "#22c55e" q_for_prompt = _replace_first_person(question, "Jared") bio_relevant = any(kw in q_lower for kw in {