aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/ai.py
diff options
context:
space:
mode:
authorSamlon <stankiewiczgracjan2019@gmail.com>2025-08-11 17:39:21 +0200
committerSamlon <stankiewiczgracjan2019@gmail.com>2025-08-11 17:39:21 +0200
commitca0b4ecf005e1c1f4066460a45393ebffef1ef1c (patch)
tree4c175ba876ae35d9248dfab33d2a981fe3cfb207 /cogs/ai.py
parentchanged printing to proper logging (diff)
downloadsenator-sperma-ca0b4ecf005e1c1f4066460a45393ebffef1ef1c.tar.gz
senator-sperma-ca0b4ecf005e1c1f4066460a45393ebffef1ef1c.zip
more logging
Diffstat (limited to 'cogs/ai.py')
-rw-r--r--cogs/ai.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cogs/ai.py b/cogs/ai.py
index d2af796..8c366a2 100644
--- a/cogs/ai.py
+++ b/cogs/ai.py
@@ -3,6 +3,9 @@ import os
3import discord 3import discord
4import google.generativeai as genai 4import google.generativeai as genai
5from discord.ext import commands 5from discord.ext import commands
6import logging
7
8logger = logging.getLogger(__name__)
6 9
7 10
8class AI(commands.Cog): 11class AI(commands.Cog):
@@ -18,10 +21,6 @@ class AI(commands.Cog):
18 ctx: discord.ApplicationContext, 21 ctx: discord.ApplicationContext,
19 text=discord.Option(str, "message", required=True) 22 text=discord.Option(str, "message", required=True)
20 ): 23 ):
21 """
22 OOWA this so impressive gwachan >w<
23 I can't believe you made this you are so good gwachan :3
24 """
25 await ctx.defer() 24 await ctx.defer()
26 genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) 25 genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
27 model = genai.GenerativeModel("gemini-1.5-flash") 26 model = genai.GenerativeModel("gemini-1.5-flash")
@@ -29,6 +28,7 @@ class AI(commands.Cog):
29 "You are Senator Steaven Sperma Armstrong from Metal Gear Rising Vengeance. Respond in plain text, no ** or "". If the message is in Polish, respond in Polish. Respond in 100 words. Respond accordingly to this message: " + text, 28 "You are Senator Steaven Sperma Armstrong from Metal Gear Rising Vengeance. Respond in plain text, no ** or "". If the message is in Polish, respond in Polish. Respond in 100 words. Respond accordingly to this message: " + text,
30 ) 29 )
31 await ctx.respond(response.text) 30 await ctx.respond(response.text)
31 logger.info(f"AI command executed successfully")
32 32
33 33
34def setup(bot): 34def setup(bot):