From 79423d6057d1032d366806eb80b95a8d4468caf1 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:42:15 -0400 Subject: [PATCH] Update overseerr.py --- overseerr/overseerr.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/overseerr/overseerr.py b/overseerr/overseerr.py index d88e116..2240ee9 100644 --- a/overseerr/overseerr.py +++ b/overseerr/overseerr.py @@ -14,17 +14,27 @@ class Overseerr(commands.Cog): } self.config.register_global(**default_global) - @commands.command() + @commands.group() @commands.admin() - async def setoverseerr(self, ctx: commands.Context, url: str, api_key: str): - """Set the Overseerr URL and API key.""" - await self.config.overseerr_url.set(url) - await self.config.overseerr_api_key.set(api_key) - await ctx.send("Overseerr URL and API key have been set.") + async def overseerr(self, ctx: commands.Context): + """Manage Overseerr settings.""" + if ctx.invoked_subcommand is None: + await ctx.send_help(ctx.command) - @commands.command() - @commands.admin() - async def setadminrole(self, ctx: commands.Context, role_name: str): + @overseerr.command(name="seturl") + async def overseerr_seturl(self, ctx: commands.Context, url: 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.""" await self.config.admin_role_name.set(role_name) await ctx.send(f"Admin role for Overseerr approvals set to {role_name}.")