From 315dd829740a8b8bf0660472987138a72ea59312 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Mon, 3 Jun 2024 00:47:24 +0100 Subject: [PATCH] Don't go further than taggable history --- src/cogs/ollama.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 1a0c198..1b6cfcf 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -1020,9 +1020,14 @@ class Ollama(commands.Cog): " Write using the style of a twitter or facebook post." ) channel = discord.utils.get(ctx.guild.text_channels, name="spam") + oldest = discord.Object(1229487300505894964) async for message in channel.history(limit=max_history): + if message.created_at <= oldest.created_at: + break if message.author.id == 1101439218334576742 and len(message.embeds): embed = message.embeds[0] + if embed.description.strip() == "NEW TRUTH": + continue if embed.type == "rich" and embed.colour and embed.colour.value == 0x5448EE: self.history.add_message(thread_id, "assistant", embed.description) self.history.add_message(thread_id, "user", "Generate a new truth post.")