mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
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:
@@ -4,10 +4,7 @@ from discord.ext import commands
|
||||
from discord.ext.commands import Context
|
||||
|
||||
|
||||
class Nick(commands.Cog, name="nick"):
|
||||
def __init__(self, bot) -> None:
|
||||
self.bot = bot
|
||||
|
||||
def nick_command():
|
||||
@commands.hybrid_command(
|
||||
name="nick",
|
||||
description="Change the nickname of a user on a server.",
|
||||
@@ -17,8 +14,8 @@ class Nick(commands.Cog, name="nick"):
|
||||
nickname="The new nickname that should be set.",
|
||||
)
|
||||
async def nick(
|
||||
self, context: Context, user: discord.User, *, nickname: str = None
|
||||
) -> None:
|
||||
self, context, user: discord.User, *, nickname: str = None
|
||||
):
|
||||
"""
|
||||
Change the nickname of a user on a server.
|
||||
|
||||
@@ -60,7 +57,5 @@ class Nick(commands.Cog, name="nick"):
|
||||
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(Nick(bot))
|
||||
|
||||
return nick
|
||||
|
||||
Reference in New Issue
Block a user