fix: Fixed db cursor in wrong place
This commit is contained in:
parent
11e76ff837
commit
9f711139d0
2
main.py
2
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)
|
||||
|
Loading…
Reference in New Issue
Block a user