Refactor bot and test code to use asynchronous methods; update get_history calls and improve test structure

This commit is contained in:
2025-02-03 09:38:05 +07:00
parent 1b9d0043e5
commit 4fd27b3197
2 changed files with 31 additions and 26 deletions

2
bot.py
View File

@@ -299,7 +299,7 @@ async def search(interaction: discord.Interaction, query: str):
"""Searches Google and sends results to the AI model."""
await interaction.response.defer(thinking=True)
user_id = interaction.user.id
history = get_history(user_id)
history = await get_history(user_id)
history.append({"role": "user", "content": query})