Proper use of hybrid_group for main command groups:

archiver: Main bot control commands
settings: Configuration commands
archivedb: Database management commands
Consistent decorator order across all commands:

@group.command() or @hybrid_group()
@guild_only()
@admin_or_permissions() (where needed)
@app_commands.describe() (for parameters)
Proper parameter descriptions using app_commands.describe for better slash command integration
This commit is contained in:
pacnpal
2024-11-16 17:37:20 +00:00
parent 82244884db
commit 771c32e11b
3 changed files with 34 additions and 35 deletions

View File

@@ -1,8 +1,7 @@
"""Module for database-related commands"""
import discord
from redbot.core.commands import Context, hybrid_group, hybrid_command, guild_only
from redbot.core.utils.mod import admin_or_permissions
from redbot.core.commands import Context, hybrid_group, guild_only, admin_or_permissions
from discord import app_commands
import logging
from ..response_handler import handle_response
@@ -101,7 +100,7 @@ def setup_database_commands(cog):
ctx, "An error occurred while disabling the database."
)
@cog.hybrid_command()
@archivedb.command(name="check")
@guild_only()
@app_commands.describe(url="The URL of the video to check")
async def checkarchived(ctx: Context, url: str):