fix: Only add user message to history on success

This commit is contained in:
2025-08-17 11:34:11 -07:00
parent be8689af56
commit 9e804856ca
2 changed files with 22 additions and 0 deletions

1
bot.py
View File

@@ -99,6 +99,7 @@ async def on_message(message):
await message.channel.send(bot_response)
except Exception as e:
print(f"An error occurred: {e}")
conversation_history[channel_id].pop() # Remove user message on error
await message.channel.send("Sorry, I had a little hiccup. Baka!")