Added function back to setting api key
This commit is contained in:
parent
76df917f76
commit
4ffc52e250
@ -126,6 +126,15 @@ class ReginaldCog(commands.Cog):
|
|||||||
await self.config.guild(ctx.guild).allowed_role.clear()
|
await self.config.guild(ctx.guild).allowed_role.clear()
|
||||||
await ctx.send("The role's permission to use the Reginald command has been revoked.")
|
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):
|
async def setup(bot):
|
||||||
"""✅ Correct async cog setup for Redbot"""
|
"""✅ Correct async cog setup for Redbot"""
|
||||||
await bot.add_cog(ReginaldCog(bot))
|
await bot.add_cog(ReginaldCog(bot))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user