roast: fix refusal prompt, add Cole/Nathan lore, expand known users
Lint / Shell (shellcheck) (push) Successful in 15s
Lint / JS (eslint) (push) Successful in 11s
Lint / Python (ruff) (push) Successful in 15s
Lint / Secret scan (gitleaks) (push) Has been cancelled
Lint / Python deps (pip-audit) (push) Has been cancelled

- Reframe prompt as a consented comedy roast between friends so the
  model doesn't refuse on safety grounds
- Add lore for lonely (Cole, 23, dishwasher, gamer) and
  natcofragomatic (Nathan, DCO Tech 3 at AWS, ginger, tape-drive nerd)
- Use a lookup table (_ROAST_LORE) so adding new users is one line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 00:48:48 -04:00
parent 0dada4c2b7
commit acf68038d8
+29 -14
View File
@@ -1740,6 +1740,24 @@ _WYNTER_LORE = (
"She cannot return to AWS for at least 5 years and has very few friends."
)
_LONELY_LORE = (
"Cole (known online as 'lonely') is a 23-year-old who works as a dishwasher at a breakfast diner. "
"He loves video games and spends most of his free time gaming."
)
_NATCO_LORE = (
"Nathan (known online as 'NatcoFragOMatic') is a DCO Tech 3 at AWS who is obsessed with old hardware "
"and tape drives in servers. He is a ginger and has a cat."
)
_ROAST_LORE: dict[str, tuple[str, str]] = {
"jared": ("Jared", _JARED_LORE),
"wynter": ("Wynter", _WYNTER_LORE),
"lonely": ("Cole", _LONELY_LORE),
"natco": ("Nathan", _NATCO_LORE),
"natcofragomatic": ("Nathan", _NATCO_LORE),
}
@command("roast", "Roast someone with AI — !roast @user")
async def cmd_roast(client: AsyncClient, room_id: str, sender: str, args: str):
@@ -1750,23 +1768,20 @@ async def cmd_roast(client: AsyncClient, room_id: str, sender: str, args: str):
target_raw = sanitize_input(args.strip())
# Determine display name and any lore context
target_lower = target_raw.lower()
lore = ""
if "jared" in target_lower or "@jared" in target_lower:
display_name = "Jared"
lore = _JARED_LORE
elif "wynter" in target_lower or "@wynter" in target_lower:
display_name = "Wynter"
lore = _WYNTER_LORE
else:
# Use the raw mention — strip Matrix ID syntax for display
target_lower = target_raw.lower().split(":")[0].lstrip("@")
display_name = target_raw.split(":")[0].lstrip("@") if target_raw.startswith("@") else target_raw
lore = ""
for key, (name, bio) in _ROAST_LORE.items():
if key in target_lower:
display_name = name
lore = bio
break
context = f"Context about {display_name}: {lore} " if lore else ""
lore_clause = f" Here is some context about them: {lore}" if lore else ""
prompt = (
f"{context}"
f"Write a savage but funny 1-2 sentence roast of {display_name}. "
f"Be creative, witty, and biting. No disclaimers, no apologies — just the roast."
f"You are a comedy roast writer for a group of friends who all consented to being roasted for fun. "
f"Write a savage, witty, 1-2 sentence roast of a person named {display_name}.{lore_clause} "
f"Make it clever and specific. Output only the roast itself — no intro, no disclaimers, no apologies."
)
try: