Update overseerr.py

This commit is contained in:
pacnpal
2024-09-30 20:42:15 -04:00
parent 89fffaf2e2
commit 79423d6057

View File

@@ -14,17 +14,27 @@ class Overseerr(commands.Cog):
} }
self.config.register_global(**default_global) self.config.register_global(**default_global)
@commands.command() @commands.group()
@commands.admin() @commands.admin()
async def setoverseerr(self, ctx: commands.Context, url: str, api_key: str): async def overseerr(self, ctx: commands.Context):
"""Set the Overseerr URL and API key.""" """Manage Overseerr settings."""
await self.config.overseerr_url.set(url) if ctx.invoked_subcommand is None:
await self.config.overseerr_api_key.set(api_key) await ctx.send_help(ctx.command)
await ctx.send("Overseerr URL and API key have been set.")
@commands.command() @overseerr.command(name="seturl")
@commands.admin() async def overseerr_seturl(self, ctx: commands.Context, url: str):
async def setadminrole(self, ctx: commands.Context, role_name: str): """Set the Overseerr URL."""
await self.config.overseerr_url.set(url)
await ctx.send("Overseerr URL has been set.")
@overseerr.command(name="setapikey")
async def overseerr_setapikey(self, ctx: commands.Context, api_key: str):
"""Set the Overseerr API key."""
await self.config.overseerr_api_key.set(api_key)
await ctx.send("Overseerr API key has been set.")
@overseerr.command(name="setadminrole")
async def overseerr_setadminrole(self, ctx: commands.Context, role_name: str):
"""Set the admin role name for Overseerr approvals.""" """Set the admin role name for Overseerr approvals."""
await self.config.admin_role_name.set(role_name) await self.config.admin_role_name.set(role_name)
await ctx.send(f"Admin role for Overseerr approvals set to {role_name}.") await ctx.send(f"Admin role for Overseerr approvals set to {role_name}.")