diff --git a/requirements.txt b/requirements.txt index 8bc947c..bb1c9b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +jishaku~=2.5 wheel>=0.42 setuptools>=69 yt-dlp @ https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 44bb20c..b407626 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -1116,6 +1116,7 @@ class Ollama(commands.Cog): await msg.edit(embed=embed) last_edit = time.time() + similar = {} for truth in truths: _ratio = fuzz.ratio(truth.content, embed.description) if truth.content == embed.description: @@ -1124,10 +1125,26 @@ class Ollama(commands.Cog): value="This truth was already truthed. Shit AI." ) elif _ratio >= 70: + similar[truth.id] = _ratio + + if similar: + if len(similar) > 1: + lns = [] + for truth_id, _ratio in similar.items(): + lns.append(f"* `{truth_id}`: {_ratio:.2f}%") embed.add_field( - name="Likely repeated truth", - value=f"Is a {_ratio:.2f}% match to truth {truth.id!r}." + name="Possibly repeated truth", + value="This truth was similar to the following existing ones:\n" + "\n".join(lns), + inline=False ) + else: + truth_id = tuple(similar)[0] + _ratio = similar[truth_id] + embed.add_field( + name="Possibly repeated truth", + value=f"This truth was {_ratio:.2f}% similar to `{truth_id}`." + ) + embed.set_footer( text="Finished generating truth based off of {:,} messages, using server {!r} | {!s}".format( len(messages) - 2, diff --git a/src/main.py b/src/main.py index a243d34..1e407f1 100644 --- a/src/main.py +++ b/src/main.py @@ -162,7 +162,7 @@ bot = Client( intents=discord.Intents.all(), ) -for module in CONFIG["jimmy"].get("modules", ["cogs/*.py"]): +for module in ["jishaku", *CONFIG["jimmy"].get("modules", ["cogs/*.py"])]: try: bot.load_extension(module) except (discord.ExtensionNotFound, ModuleNotFoundError):