This commit is contained in:
Edgar P. Burkhart 2024-06-10 09:43:46 +02:00
parent dbe4014421
commit 130013f1e1
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -20,6 +20,7 @@ aibot = AIBot(config.get("mistral_api_key"), model="open-mixtral-8x7b")
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
bot = discord.Bot(description=description, intents=intents)
@ -41,7 +42,10 @@ async def reply(message):
async def ai_reply(message):
print("Running AI")
answer = aibot.answer(message.clean_content)
prompt = message.clean_content
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",