Re-fix adding trump things
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s

This commit is contained in:
Nexus 2024-06-05 03:07:51 +01:00
parent cc4198dffe
commit 03f222a1a3
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -1041,8 +1041,15 @@ class Ollama(commands.Cog):
truths: list[TruthPayload] = list(map(lambda t: TruthPayload.model_validate(t), truths)) truths: list[TruthPayload] = list(map(lambda t: TruthPayload.model_validate(t), truths))
for truth in truths: for truth in truths:
if truth.author == "trump": if truth.author == "trump":
self.history.add_message(thread_id, "assistant", truth.content, save=False) await asyncio.to_thread(
break functools.partial(
self.history.add_message,
thread_id,
"assistant",
truth.content,
save=False
)
)
self.history.add_message(thread_id, "user", "Generate a new truth post.") self.history.add_message(thread_id, "user", "Generate a new truth post.")
tried = set() tried = set()
@ -1078,7 +1085,7 @@ class Ollama(commands.Cog):
last_edit = time.time() last_edit = time.time()
for truth in truths: for truth in truths:
if truth["content"] == embed.description: if truth.content == embed.description:
embed.add_field( embed.add_field(
name="Repeated truth :(", name="Repeated truth :(",
value="This truth was already truthed. Shit AI." value="This truth was already truthed. Shit AI."