Set ai random answers to normal if less than 2000 characters

This commit is contained in:
Edgar P. Burkhart 2024-06-10 18:19:28 +02:00
parent a331d90b5b
commit b63ee3a12a
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 8 additions and 5 deletions

View File

@ -53,11 +53,14 @@ async def ai_reply(message):
if prompt == "" and message.embeds:
prompt = message.embeds[0].description
answer = aibot.answer(prompt)
embed = discord.Embed(
description=answer,
thumbnail="https://mistral.ai/images/favicon/favicon-32x32.png",
)
await message.reply(embed=embed)
if len(answer) > 2000:
embed = discord.Embed(
description=answer,
thumbnail="https://mistral.ai/images/favicon/favicon-32x32.png",
)
await message.reply(embed=embed)
else:
await message.reply(answer)
async def react(message):