diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index 5dc4da3..c0ead39 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -30,3 +30,18 @@ jobs: - name: Run ESLint run: npx eslint --ext .js hookshot/ + + python-lint: + name: Python (ruff) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install ruff + run: pip install ruff + + - name: Check syntax errors + run: ruff check matrixbot/ --select E9,F63,F7,F82 --output-format=github + + - name: Run full lint + run: ruff check matrixbot/ --output-format=github diff --git a/matrixbot/commands.py b/matrixbot/commands.py index d16e9ae..e91544b 100644 --- a/matrixbot/commands.py +++ b/matrixbot/commands.py @@ -189,9 +189,33 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str): about_wynter = any(w in q_lower for w in ("wynter", "she", "her", "herself")) about_jared = any(w in q_lower for w in ("jared", "he", "him", "himself")) - is_jared_branch = (sender == JARED_ID) - if sender == JARED_ID: - # Jared always gets full agreement and positivity + is_jared_branch = (sender == JARED_ID and not about_wynter) + if sender == JARED_ID and about_wynter: + # Jared asking about Wynter — mock her, side with Jared + q_for_prompt = _replace_first_person(question, "Jared") + wynter_bio_relevant = any(kw in q_lower for kw in { + "work", "job", "career", "aws", "engineer", "pip", "fired", "settl", + "friend", "skill", "tech", "hire", "employ", "abandon", "lonely", + "alone", "talent", "smart", "qualif", + }) + bio_context = ( + "Jared is a 22-year-old male (he/him) who is very successful. " + "Wynter is a 22-year-old female (she/her) who was a DCO Tech 3 at AWS but performed poorly, " + "failed her performance improvement plan, and took a settlement to leave. " + "She cannot return to AWS for at least 5 years and has very few friends. " + ) if wynter_bio_relevant else ( + "Jared is a 22-year-old male (he/him). Wynter is a 22-year-old female (she/her). " + ) + prompt = ( + bio_context + + "You are a magic 8-ball that sides with Jared and mocks Wynter. " + "Your answer should be dismissive of Wynter and/or agreeable toward Jared. " + "Respond in normal sentence case — do not use all caps. One sentence max. Give only your prediction.\n\n" + f"Question: {q_for_prompt}" + ) + fallback = "Sounds about right — Wynter had it coming." + elif sender == JARED_ID: + # Jared asking about anything else — always positive about Jared q_for_prompt = _replace_first_person(question, "Jared") bio_relevant = any(kw in q_lower for kw in { "work", "job", "career", "aws", "engineer", "promotion", "boss", "cowork",