From 4880229e268a3c1b5a9b31695cdfcfdefebdbac3 Mon Sep 17 00:00:00 2001 From: Aaron Crate Date: Thu, 26 Mar 2026 16:48:26 -0500 Subject: [PATCH] boy you said it --- garfpy/aod.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/garfpy/aod.py b/garfpy/aod.py index e13b651..da100cd 100644 --- a/garfpy/aod.py +++ b/garfpy/aod.py @@ -1,4 +1,5 @@ import os +import re import json import discord from garfpy import logger @@ -121,3 +122,17 @@ async def aod_message(garfbot, message): for field, values in zip(table_fields, table_columns): stats_embed.add_field(name=field, value="\n".join(values), inline=True) await message.channel.send(embed=stats_embed) + + # Boy You Said It + words = re.findall(r"[a-zA-Z']+", message.content.lower()) + stops = {"a", "an", "the", "and", "or", "but", "is", "it", "in", "on", "at", "to", "of"} + words = [w for w in words if w not in stops] + + if words: + firsts = [w[0] for w in words] + commons = max(set(firsts), key=firsts.count) + count = firsts.count(commons) + + if count >= 3 or (len(words) >= 2 and count / len(words) >= 0.75): + await message.channel.send("Boy, you said it!") +