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

@@ -585,7 +585,23 @@ class Music(commands.Cog):
bar = '' * filled_length + '' * (length - filled_length)
return bar
@commands.command(name="play", aliases=['p'], usage="play <query>", help="Plays a song or playlist.")
@commands.hybrid_group(
name="music",
aliases=["m"],
description="Music player commands.",
fallback="help",
invoke_without_command=True,
)
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
async def music(self, ctx: commands.Context):
"""Music root — use `/music <subcommand>` or `>music <subcommand>`."""
if ctx.subcommand_passed is None:
await ctx.send_help(ctx.command)
ctx.command.reset_cooldown(ctx)
@music.command(name="play", aliases=['p'], usage="music play <query>", help="Plays a song or playlist.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -594,7 +610,7 @@ class Music(commands.Cog):
await self.play_source(ctx, query)
@commands.command(name="search", usage="search <query>", help="Searches music from multiple platforms.")
@music.command(name="search", usage="music search <query>", help="Searches music from multiple platforms.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -606,7 +622,7 @@ class Music(commands.Cog):
await ctx.send(view=PlatformSelectView(ctx, query))
@commands.command(name="nowplaying", aliases=["nop"], usage="nowplaying", help="Shows the info about current playing song.")
@music.command(name="nowplaying", aliases=["nop"], usage="music nowplaying", help="Shows the info about current playing song.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -659,7 +675,7 @@ class Music(commands.Cog):
await ctx.send(view=view)
@commands.command(name="autoplay", usage="autoplay", help="Toggles autoplay mode.")
@music.command(name="autoplay", usage="music autoplay", help="Toggles autoplay mode.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -679,7 +695,7 @@ class Music(commands.Cog):
)
await ctx.send(view=CV2(f"{TICK} Autoplay {'enabled' if vc.autoplay == wavelink.AutoPlayMode.enabled else 'disabled'} by {ctx.author.mention}."))
@commands.command(name="loop", usage="loop", help="Toggles loop mode.")
@music.command(name="loop", usage="music loop", help="Toggles loop mode.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -700,7 +716,7 @@ class Music(commands.Cog):
await ctx.send(view=CV2("I'm not connected to a voice channel."))
@commands.command(name="pause", usage="pause", help="Pauses the current song.")
@music.command(name="pause", usage="music pause", help="Pauses the current song.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -721,7 +737,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2(f"{WARNING} Nothing is playing or already paused."))
@commands.command(name="resume", usage="resume", help="Resumes the paused song.")
@music.command(name="resume", usage="music resume", help="Resumes the paused song.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -742,7 +758,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("Player is not paused."))
@commands.command(name="skip", usage="skip", help="Skips the current song.")
@music.command(name="skip", usage="music skip", help="Skips the current song.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -767,7 +783,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2(f"{WARNING} No song is playing or in the queue to skip."))
@commands.command(name="shuffle", usage="shuffle", help="Shuffles the queue.")
@music.command(name="shuffle", usage="music shuffle", help="Shuffles the queue.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -787,7 +803,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("Queue is empty."))
@commands.command(name="stop", usage="stop", help="Stops the current song and clears the queue.")
@music.command(name="stop", usage="music stop", help="Stops the current song and clears the queue.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -810,7 +826,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("Nothing is playing to stop."))
@commands.command(name="volume", aliases=["vol"], usage="volume <level>", help="Sets the volume of the player.")
@music.command(name="volume", aliases=["vol"], usage="music volume <level>", help="Sets the volume of the player.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -834,7 +850,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("Bot is not connected to a voice channel."))
@commands.command(name="queue", usage="queue", help="Shows the current queue.")
@music.command(name="queue", usage="music queue", help="Shows the current queue.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -860,7 +876,7 @@ class Music(commands.Cog):
ctx=ctx)
await paginator.paginate()
@commands.command(name="clearqueue", usage="clearqueue", help="Clears the queue.")
@music.command(name="clearqueue", usage="music clearqueue", help="Clears the queue.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -881,7 +897,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("No queue to clear."))
@commands.command(name="replay", usage="replay", help="Replays the current song.")
@music.command(name="replay", usage="music replay", help="Replays the current song.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -902,7 +918,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("No track is currently playing."))
@commands.command(name="join", aliases=["connect"], usage="join", help="Joins the voice channel.")
@music.command(name="join", aliases=["connect"], usage="music join", help="Joins the voice channel.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -913,7 +929,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("You need to join a voice channel first."))
@commands.hybrid_command(name="disconnect", aliases=["dc", "leave"], usage="disconnect", help="Disconnects the bot from the voice channel.")
@music.command(name="disconnect", aliases=["dc", "leave"], usage="music disconnect", help="Disconnects the bot from the voice channel.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)
@@ -933,7 +949,7 @@ class Music(commands.Cog):
else:
await ctx.send(view=CV2("Bot is not connected to any voice channel."))
@commands.command(name="seek", usage="seek <percentage>", help="Seeks to a specific percentage of the song.")
@music.command(name="seek", usage="music seek <percentage>", help="Seeks to a specific percentage of the song.")
@blacklist_check()
@ignore_check()
@commands.cooldown(1, 3, commands.BucketType.user)