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,11 +4,8 @@ from discord.ext import commands
from discord.ext.commands import Context
class Warnings(commands.Cog, name="warnings"):
def __init__(self, bot) -> None:
self.bot = bot
async def send_embed(self, context: Context, embed: discord.Embed, *, ephemeral: bool = False) -> None:
def warnings_command():
async def send_embed(context, embed: discord.Embed, *, ephemeral: bool = False) -> None:
interaction = getattr(context, "interaction", None)
if interaction is not None:
if interaction.response.is_done():
@@ -22,7 +19,7 @@ class Warnings(commands.Cog, name="warnings"):
name="warning",
description="Manage warnings of a user on a server.",
)
async def warning(self, context: Context) -> None:
async def warning(self, context) -> None:
"""
Manage warnings of a user on a server.
@@ -170,5 +167,4 @@ class Warnings(commands.Cog, name="warnings"):
async def setup(bot) -> None:
await bot.add_cog(Warnings(bot))
return warning