refactor(moderation): commands into group cog

Converted individual moderation command cogs (ban, kick, purge, warnings, archive, hackban, nick) into command factory functions and registered them under a new Moderation GroupCog in cogs/moderation/__init__.py. Updated bot.py and help.py to support the new moderation group and category. This improves organization and enables grouped moderation commands.
This commit is contained in:
neoarz
2025-09-28 23:07:46 -04:00
parent 51393ece85
commit e5ea7f1dac
10 changed files with 112 additions and 79 deletions

View File

@@ -4,10 +4,7 @@ from discord.ext import commands
from discord.ext.commands import Context
class Kick(commands.Cog, name="kick"):
def __init__(self, bot) -> None:
self.bot = bot
def kick_command():
@commands.hybrid_command(
name="kick",
description="Kicks a user from the server.",
@@ -17,8 +14,8 @@ class Kick(commands.Cog, name="kick"):
reason="The reason why the user should be kicked.",
)
async def kick(
self, context: Context, user: discord.User, *, reason: str = "Not specified"
) -> None:
self, context, user: discord.User, *, reason: str = "Not specified"
):
try:
member = context.guild.get_member(user.id)
if not member:
@@ -122,7 +119,5 @@ class Kick(commands.Cog, name="kick"):
color=0xE02B2B,
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
await context.send(embed=embed, ephemeral=True)
async def setup(bot) -> None:
await bot.add_cog(Kick(bot))
return kick