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

View file

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