Added function back to setting api key

This commit is contained in:
AllfatherHatt 2025-02-20 19:38:49 +01:00
parent 76df917f76
commit 4ffc52e250

View File

@ -125,6 +125,15 @@ class ReginaldCog(commands.Cog):
"""✅ Removes a role's permission to use Reginald."""
await self.config.guild(ctx.guild).allowed_role.clear()
await ctx.send("The role's permission to use the Reginald command has been revoked.")
@commands.guild_only()
@commands.has_permissions(manage_guild=True)
@commands.command(help="Set the OpenAI API key")
async def setreginaldcogapi(self, ctx, api_key):
"""Allows an admin to set the OpenAI API key for Reginald."""
await self.config.guild(ctx.guild).openai_api_key.set(api_key)
await ctx.send("OpenAI API key set successfully.")
async def setup(bot):
"""✅ Correct async cog setup for Redbot"""