fix: Only add user message to history on success
This commit is contained in:
1
bot.py
1
bot.py
@@ -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!")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user