From dc53c9e3518926237bf8ebcc5c01e4b63e14869d Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sat, 8 Jun 2024 20:06:59 +0100 Subject: [PATCH] Fix impersonate command --- src/cogs/ollama.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 1190d2f..291518d 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -1211,7 +1211,7 @@ class Ollama(commands.Cog): """ search = max(10, min(search, 1000)) channels = channels or [ctx.channel] - messages = [] + messages: list[discord.Message] = [] msg = await ctx.reply("Gathering messages, please wait. This may take a while.") for channel in channels: async for message in channel.history(limit=search): @@ -1264,10 +1264,9 @@ class Ollama(commands.Cog): colour=0x6559FF ) embed.set_author(name=user.display_name, icon_url=user.display_avatar.url) - msg = await ctx.reply(embed=embed) last_edit = time.time() - messages = self.history.get_history(thread_id) - with client.new_chat("llama2-uncensored:7b-chat", messages) as handler: + thread_messages = self.history.get_history(thread_id) + with client.new_chat("llama2-uncensored:7b-chat", thread_messages) as handler: await msg.edit(content="Generating message...") async for ln in handler: embed.description += ln["message"]["content"]