Generalize image roast to handle selfies, memes, and any image

The prompt was scoreboard-only, so selfies got nonsensical stat-based
roasts. Now the LLM identifies what's in the image and roasts accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 12:15:22 -05:00
parent 28fb66d5f9
commit b5e401f036
2 changed files with 19 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ from discord.ext import commands
logger = logging.getLogger("bcs.chat")
_PROMPTS_DIR = Path(__file__).resolve().parent.parent / "prompts"
SCOREBOARD_ROAST = (_PROMPTS_DIR / "scoreboard_roast.txt").read_text(encoding="utf-8")
IMAGE_ROAST = (_PROMPTS_DIR / "scoreboard_roast.txt").read_text(encoding="utf-8")
_IMAGE_TYPES = {"png", "jpg", "jpeg", "gif", "webp"}
@@ -115,9 +115,9 @@ class ChatCog(commands.Cog):
await typing_ctx.__aenter__()
if image_attachment:
# --- Image path: scoreboard roast ---
# --- Image path: roast the image ---
image_bytes = await image_attachment.read()
user_text = content if content else "Roast this scoreboard."
user_text = content if content else ""
logger.info(
"Image roast request in #%s from %s (%s, %s)",
message.channel.name,
@@ -127,7 +127,7 @@ class ChatCog(commands.Cog):
)
response = await self.bot.llm_heavy.analyze_image(
image_bytes,
SCOREBOARD_ROAST,
IMAGE_ROAST,
user_text=user_text,
on_first_token=start_typing,
)