Refactor command definitions across various cogs to replace hybrid commands with regular commands for improved consistency and clarity. Update command structures in moderation, music, and other cogs to enhance user experience and streamline command handling.
Some checks failed
CI / Bot (Python) (push) Successful in 12s
CI / Dashboard (Next.js) (push) Failing after 9s

This commit is contained in:
TheOnlyMace
2026-07-21 22:59:25 +02:00
parent a52d84467d
commit d24b810164
25 changed files with 436 additions and 90 deletions

View File

@@ -57,16 +57,34 @@ class Whitelist(commands.Cog):
''')
await self.db.commit()
@commands.hybrid_command(name='whitelist', aliases=['wl'], help="Whitelists a user from antinuke for a specific action.")
@commands.hybrid_group(
name="whitelist",
aliases=["wl"],
description="Manage antinuke whitelist.",
fallback="help",
invoke_without_command=True,
help="Whitelists a user from antinuke for a specific action.",
)
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 5, commands.BucketType.user)
@commands.max_concurrency(1, per=commands.BucketType.default, wait=False)
@commands.guild_only()
@commands.has_permissions(administrator=True)
async def whitelist(self, ctx):
"""Whitelist root — use `/whitelist <subcommand>` or `>whitelist <subcommand>`."""
if ctx.subcommand_passed is None:
await ctx.send_help(ctx.command)
ctx.command.reset_cooldown(ctx)
async def whitelist(self, ctx, member: discord.Member = None):
@whitelist.command(name="add", help="Whitelists a user from antinuke for a specific action.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 5, commands.BucketType.user)
@commands.max_concurrency(1, per=commands.BucketType.default, wait=False)
@commands.guild_only()
@commands.has_permissions(administrator=True)
async def whitelist_add(self, ctx, member: discord.Member = None):
if ctx.guild.member_count < 2:
view = CV2(f"{CROSS} Error", "Your Server Doesn't Meet My 30 Member Criteria")
return await ctx.send(view=view)
@@ -101,7 +119,7 @@ class Whitelist(commands.Cog):
view = CV2(
"__Whitelist Commands__",
"**Adding a user to the whitelist means that no actions will be taken against them if they trigger the Anti-Nuke Module.**",
f"**Usage**\n{ARROWRED} `{prefix}whitelist @user/id`\n{ARROWRED} `{prefix}wl @user`"
f"**Usage**\n{ARROWRED} `{prefix}whitelist add @user/id`\n{ARROWRED} `{prefix}wl add @user`"
)
return await ctx.send(view=view)
@@ -252,7 +270,7 @@ class Whitelist(commands.Cog):
await msg.edit(view=None)
@commands.hybrid_command(name='whitelisted', aliases=['wlist'], help="Shows the list of whitelisted users.")
@whitelist.command(name="list", aliases=["whitelisted", "wlist"], help="Shows the list of whitelisted users.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 5, commands.BucketType.user)
@@ -308,7 +326,7 @@ class Whitelist(commands.Cog):
await ctx.send(view=view)
@commands.hybrid_command(name="whitelistreset", aliases=['wlreset'], help="Resets the whitelisted users.")
@whitelist.command(name="reset", aliases=["whitelistreset", "wlreset"], help="Resets the whitelisted users.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 10, commands.BucketType.user)