From 9f711139d099426457553a7eeb3f3a0d864e0544 Mon Sep 17 00:00:00 2001 From: showdown76py Date: Wed, 17 Jan 2024 11:45:19 +0100 Subject: [PATCH] fix: Fixed db cursor in wrong place --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 2d11352..30455bc 100644 --- a/main.py +++ b/main.py @@ -85,9 +85,9 @@ async def on_message(message: discord.Message): for arg in arguments.keys(): bprompt = bprompt.replace(f'|{arg}|', arguments[arg]) + c = db.cursor() if message.author not in cached_conversations: cached_conversations[message.author] = copeai_backend.conversation.Conversation() - c = db.cursor() c.execute('SELECT * FROM message_history WHERE user_id = ? ORDER BY timestamp DESC', (message.author.id,)) msgs = c.fetchall() message_token_usage = num_tokens_from_string(message.content)