diff --git a/birthday/README.md b/birthday/README.md index 5ebd86c..a0788a2 100644 --- a/birthday/README.md +++ b/birthday/README.md @@ -1,6 +1,6 @@ # Birthday Cog for Red-DiscordBot -This cog allows you to assign a special role to users on their birthday and send them a celebratory message with cake (or pie) emojis! +This cog allows you to assign a special role to users on their birthday and send them a celebratory message with cake (or pie) emojis! Supports both traditional prefix commands and slash commands. ## Installation @@ -29,13 +29,17 @@ Replace `[p]` with your bot's prefix. ## Setup -Before using the cog, you need to set it up: +Before using the cog, you need to set it up. You can use either prefix commands or slash commands: 1. Set the birthday role: ``` [p]birthdayset role @Birthday ``` + or + ``` + /birthdayset role @Birthday + ``` **Note:** The bot's role must be above the birthday role in the server's role hierarchy, but users assigning the birthday role do not need to have a role above it. @@ -44,18 +48,30 @@ Before using the cog, you need to set it up: ``` [p]birthdayset addrole @Moderator ``` + or + ``` + /birthdayset addrole @Moderator + ``` 3. (Optional) Set the timezone for role expiration: ``` [p]birthdayset timezone America/New_York ``` + or + ``` + /birthdayset timezone America/New_York + ``` 4. (Optional) Set a specific channel for birthday announcements: ``` [p]birthdayset channel #birthdays ``` + or + ``` + /birthdayset channel #birthdays + ``` If not set, the birthday message will be sent in the channel where the command is used. @@ -66,6 +82,10 @@ To assign the birthday role to a user: ``` [p]birthday @User ``` +or +``` +/birthday @User +``` This will assign the birthday role to the user and send a celebratory message with random cake (or pie) emojis. The role will be automatically removed at midnight in the specified timezone. @@ -78,15 +98,19 @@ This will assign the birthday role to the user and send a celebratory message wi - Option to set a specific channel for birthday announcements (defaults to the channel where the command is used) - Restricts usage of the birthday command to specified roles - Users can assign the birthday role without needing a role higher than it in the hierarchy +- Full slash command support for all commands ## Commands -- `[p]birthdayset role`: Set the birthday role -- `[p]birthdayset addrole`: Add a role that can use the birthday command -- `[p]birthdayset removerole`: Remove a role from using the birthday command -- `[p]birthdayset timezone`: Set the timezone for the birthday role expiration -- `[p]birthdayset channel`: Set the channel for birthday announcements -- `[p]birthday`: Assign the birthday role to a user +All commands support both prefix and slash command syntax: + +- `[p]birthdayset role` or `/birthdayset role`: Set the birthday role +- `[p]birthdayset addrole` or `/birthdayset addrole`: Add a role that can use the birthday command +- `[p]birthdayset removerole` or `/birthdayset removerole`: Remove a role from using the birthday command +- `[p]birthdayset timezone` or `/birthdayset timezone`: Set the timezone for the birthday role expiration +- `[p]birthdayset channel` or `/birthdayset channel`: Set the channel for birthday announcements +- `[p]birthday` or `/birthday`: Assign the birthday role to a user +- `[p]bdaycheck` or `/bdaycheck`: Check upcoming birthday role removal tasks ## Support diff --git a/birthday/birthday.py b/birthday/birthday.py index ca23a1a..2b70784 100644 --- a/birthday/birthday.py +++ b/birthday/birthday.py @@ -22,11 +22,12 @@ class Birthday(commands.Cog): self.config.register_guild(**default_guild) self.birthday_tasks = {} - @commands.group() + @commands.hybrid_group() @checks.admin_or_permissions(manage_roles=True) async def birthdayset(self, ctx): """Birthday cog settings.""" - pass + if ctx.invoked_subcommand is None: + await ctx.send_help() @birthdayset.command() @checks.is_owner() @@ -69,7 +70,7 @@ class Birthday(commands.Cog): allowed_roles.remove(role.id) await ctx.send(f"Removed {role.name} from the list of roles that can use the birthday command.") - @commands.command() + @commands.hybrid_command() async def birthday(self, ctx, member: discord.Member): """Assign the birthday role to a user until midnight in the set timezone.""" # Check if the user has permission to use this command @@ -79,7 +80,7 @@ class Birthday(commands.Cog): birthday_role_id = await self.config.guild(ctx.guild).birthday_role() if not birthday_role_id: - return await ctx.send("The birthday role hasn't been set. An admin needs to set it using `[p]birthdayset role`.") + return await ctx.send("The birthday role hasn't been set. An admin needs to set it using `/birthdayset role`.") birthday_role = ctx.guild.get_role(birthday_role_id) if not birthday_role: @@ -122,7 +123,7 @@ class Birthday(commands.Cog): await self.schedule_birthday_role_removal(ctx.guild, member, birthday_role, midnight) - @commands.command() + @commands.hybrid_command() async def bdaycheck(self, ctx): """Check the upcoming birthday role removal tasks.""" # Check if the user has permission to use this command diff --git a/overseerr/README.md b/overseerr/README.md index b33d1c7..09e7889 100644 --- a/overseerr/README.md +++ b/overseerr/README.md @@ -1,6 +1,6 @@ # Overseerr Cog for Red Discord Bot -This cog allows interaction with [Overseerr](https://overseerr.dev/) directly from Discord. Users can search for movies or TV shows, request them, and have admins approve requests. It's designed for servers with Overseerr set up for managing media requests. +This cog allows interaction with [Overseerr](https://overseerr.dev/) directly from Discord. Users can search for movies or TV shows, request them, and have admins approve requests. It's designed for servers with Overseerr set up for managing media requests. Supports both traditional prefix commands and slash commands. ## Installation @@ -30,62 +30,89 @@ Replace `[p]` with your bot's prefix. ## Setup -Before using the cog, you'll need to configure it: +Before using the cog, you'll need to configure it. You can use either prefix commands or slash commands: -1. Set the Overseerr URL and API key: +1. Set the Overseerr URL: ``` [p]overseerr url https://your.overseerr.instance ``` + or + ``` + /overseerr url https://your.overseerr.instance + ``` + 2. Set the Overseerr API key: ``` [p]overseerr apikey your_api_key ``` -4. Set the admin role allowed to approve requests: + or ``` - [p]adminrole @OverseerrAdmins + /overseerr apikey your_api_key + ``` + +3. Set the admin role allowed to approve requests: + ``` + [p]overseerr adminrole @OverseerrAdmins + ``` + or + ``` + /overseerr adminrole @OverseerrAdmins ``` ## Usage -Users can request movies or TV shows using the following command: +Users can request movies or TV shows using: ``` [p]request Movie/TV Show Name ``` +or +``` +/request Movie/TV Show Name +``` Admins can approve requests using: ``` [p]approve request_id ``` +or +``` +/approve request_id +``` ## Features - **Set Overseerr URL and API key**: Admins can configure the Overseerr URL and API key for API interactions. - **Search and request media**: Users can search for movies or TV shows and request them directly in Discord. - **Media availability status**: The cog checks if media is already available or has been requested before making new requests. - **Approve requests**: Admins with the appropriate role can approve Overseerr requests within Discord. +- **Full slash command support**: All commands can be used as both traditional prefix commands and Discord slash commands. ## Commands +All commands support both prefix and slash command syntax: + ### Admin Commands -- **`[p]overseerr url `** +- **`[p]overseerr url `** or **`/overseerr url `** - Set the Overseerr URL for the bot to communicate with Overseerr. - - Example: `[p]overseerr https://your-overseerr-url` -- **`[p]overseerr apikey `** - - Set the Overseerr API Key. retrieved from `https://your-overseerr-url/settings`. - - Example: `[p]overseerr apikey 4OK6WLU8Fv2TrZfcOskLZb2PK5WA3547Jz2fEfJqfkLiT34xUP0D48Z7jwC9lC8xU9` -- **`[p]overseerr adminrole `** + - Example: `[p]overseerr url https://your-overseerr-url` or `/overseerr url https://your-overseerr-url` + +- **`[p]overseerr apikey `** or **`/overseerr apikey `** + - Set the Overseerr API Key, retrieved from `https://your-overseerr-url/settings`. + - Example: `[p]overseerr apikey 4OK6WLU8Fv2T...` or `/overseerr apikey 4OK6WLU8Fv2T...` + +- **`[p]overseerr adminrole `** or **`/overseerr adminrole `** - Set the name of the admin role that is allowed to approve Overseerr requests. - - Example: `[p]overseerr adminrole @Overseerr Admin` + - Example: `[p]overseerr adminrole @Overseerr Admin` or `/overseerr adminrole @Overseerr Admin` ### User Commands -- **`[p]request `** +- **`[p]request `** or **`/request `** - Search for a movie or TV show and request it if it's not already available or requested. - - Example: `[p]request The Matrix` + - Example: `[p]request The Matrix` or `/request The Matrix` -- **`[p]approve `** +- **`[p]approve `** or **`/approve `** - Approve a media request by its request ID (requires the admin role). - - Example: `[p]approve 123` + - Example: `[p]approve 123` or `/approve 123` ## Support diff --git a/overseerr/overseerr.py b/overseerr/overseerr.py index 6a85c69..3667527 100644 --- a/overseerr/overseerr.py +++ b/overseerr/overseerr.py @@ -1,9 +1,9 @@ import aiohttp from redbot.core import commands, Config from redbot.core.bot import Red -import asyncio # Import asyncio +import asyncio import json -import urllib.parse # Import for encoding URLs +import urllib.parse class Overseerr(commands.Cog): def __init__(self, bot: Red): @@ -18,11 +18,12 @@ class Overseerr(commands.Cog): ### GROUP: SETTINGS COMMANDS ### - @commands.group() + @commands.hybrid_group() @commands.admin() async def overseerr(self, ctx: commands.Context): """Base command group for Overseerr configuration.""" - pass + if ctx.invoked_subcommand is None: + await ctx.send_help() @overseerr.command() async def url(self, ctx: commands.Context, url: str): @@ -45,14 +46,14 @@ class Overseerr(commands.Cog): ### REQUEST & APPROVAL COMMANDS ### - @commands.command() + @commands.hybrid_command() async def request(self, ctx: commands.Context, *, query: str): """Search and request a movie or TV show on Overseerr.""" overseerr_url = await self.config.overseerr_url() overseerr_api_key = await self.config.overseerr_api_key() if not overseerr_url or not overseerr_api_key: - await ctx.send("Overseerr is not configured. Please ask an admin to set it up.") + await ctx.send("Overseerr is not configured. Please ask an admin to set it up using `/overseerr url` and `/overseerr apikey`.") return search_url = f"{overseerr_url}/api/v1/search" @@ -135,7 +136,7 @@ class Overseerr(commands.Cog): else: await ctx.send(f"Failed to request {media_type} '{selected_result['title']}'. Please try again later.") - @commands.command() + @commands.hybrid_command() async def approve(self, ctx: commands.Context, request_id: int): """Approve a request on Overseerr.""" admin_role_name = await self.config.admin_role_name() @@ -147,7 +148,7 @@ class Overseerr(commands.Cog): overseerr_api_key = await self.config.overseerr_api_key() if not overseerr_url or not overseerr_api_key: - await ctx.send("Overseerr is not configured. Please ask an admin to set it up.") + await ctx.send("Overseerr is not configured. Please ask an admin to set it up using `/overseerr url` and `/overseerr apikey`.") return approve_url = f"{overseerr_url}/api/v1/request/{request_id}/approve" @@ -181,5 +182,5 @@ class Overseerr(commands.Cog): return status return "Status Unknown" -def setup(bot: Red): - bot.add_cog(Overseerr(bot)) +async def setup(bot: Red): + await bot.add_cog(Overseerr(bot)) diff --git a/videoarchiver/README.md b/videoarchiver/README.md index 884d71c..28cfa42 100644 --- a/videoarchiver/README.md +++ b/videoarchiver/README.md @@ -1,6 +1,6 @@ # VideoArchiver Cog -A Red-DiscordBot cog for automatically archiving videos from monitored Discord channels. +A Red-DiscordBot cog for automatically archiving videos from monitored Discord channels. Supports both traditional prefix commands and Discord slash commands. ## Features @@ -13,6 +13,7 @@ A Red-DiscordBot cog for automatically archiving videos from monitored Discord c - Hardware-accelerated video processing (when available) - Customizable notification messages - Queue persistence across bot restarts +- Full slash command support for all commands ## File Structure @@ -43,43 +44,128 @@ The cog is organized into several modules for better maintainability: ## Configuration -Use the following commands to configure the cog: +Use the following commands to configure the cog. All commands support both prefix and slash command syntax: ### Channel Settings -- `[p]va setchannel `: Set the archive channel -- `[p]va setnotification `: Set the notification channel -- `[p]va setlogchannel `: Set the log channel -- `[p]va addmonitor `: Add a channel to monitor -- `[p]va removemonitor `: Remove a monitored channel +- Set the archive channel: + ``` + [p]va setchannel + ``` + or + ``` + /va setchannel + ``` + +- Set the notification channel: + ``` + [p]va setnotification + ``` + or + ``` + /va setnotification + ``` + +- Set the log channel: + ``` + [p]va setlogchannel + ``` + or + ``` + /va setlogchannel + ``` + +- Add/remove a monitored channel: + ``` + [p]va addmonitor + [p]va removemonitor + ``` + or + ``` + /va addmonitor + /va removemonitor + ``` ### Role Management -- `[p]va addrole `: Add a role allowed to trigger archiving -- `[p]va removerole `: Remove an allowed role -- `[p]va listroles`: List allowed roles +- Add/remove allowed roles: + ``` + [p]va addrole + [p]va removerole + [p]va listroles + ``` + or + ``` + /va addrole + /va removerole + /va listroles + ``` ### Video Settings -- `[p]va setformat `: Set video format (e.g., mp4, webm) -- `[p]va setquality `: Set maximum video quality (e.g., 1080) -- `[p]va setmaxsize `: Set maximum file size in MB -- `[p]va setconcurrent `: Set number of concurrent downloads (1-5) +- Set video format and quality: + ``` + [p]va setformat + [p]va setquality + [p]va setmaxsize + [p]va setconcurrent + ``` + or + ``` + /va setformat + /va setquality + /va setmaxsize + /va setconcurrent + ``` ### Message Settings -- `[p]va setduration `: Set how long to keep archive messages -- `[p]va settemplate