import os import discord import google.generativeai as genai from discord.ext import commands import logging logger = logging.getLogger(__name__) class AI(commands.Cog): def __init__(self, bot): self.bot = bot @commands.slash_command( name="senator", description="SEENATOR", ) async def senator( self, ctx: discord.ApplicationContext, text=discord.Option(str, "message", required=True) ): await ctx.defer() genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) model = genai.GenerativeModel("gemini-1.5-flash") response = model.generate_content( "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, ) await ctx.respond(response.text) logger.info(f"AI command executed successfully") def setup(bot): bot.add_cog(AI(bot))