Implement slash command synchronization features in environment files and update command definitions to hybrid commands across various cogs. Enhance command registration for improved user experience and streamline command handling in the bot.
This commit is contained in:
@@ -25,14 +25,14 @@ class Global(commands.Cog):
|
||||
self.local_frozen_nicks = {}
|
||||
self.client.frozen_nicknames = {}
|
||||
|
||||
@commands.group(name="global", invoke_without_command=True)
|
||||
@commands.hybrid_group(name="global", invoke_without_command=True)
|
||||
@commands.is_owner()
|
||||
async def global_command(self, ctx: commands.Context):
|
||||
if ctx.subcommand_passed is None:
|
||||
await ctx.send_help(ctx.command)
|
||||
ctx.command.reset_cooldown(ctx)
|
||||
|
||||
@commands.command(name="GB",help="Bans the user from all mutual guilds.")
|
||||
@commands.hybrid_command(name="GB",help="Bans the user from all mutual guilds.")
|
||||
@commands.is_owner()
|
||||
async def global_ban(self, ctx: commands.Context, user: discord.User, reason: str = "Severe violations of Discord's terms of service."):
|
||||
mutual_guilds = [guild for guild in self.client.guilds if guild.get_member(user.id)]
|
||||
@@ -563,7 +563,7 @@ class Global(commands.Cog):
|
||||
await ctx.send(f"✅ | Nickname freezing stopped for {user.name}.")
|
||||
|
||||
|
||||
@commands.command(name="freezenick", help="Freezes a member's nickname in the current server.")
|
||||
@commands.hybrid_command(name="freezenick", help="Freezes a member's nickname in the current server.")
|
||||
@commands.has_permissions(manage_nicknames=True)
|
||||
async def freeze_nickname(self, ctx: commands.Context, member: Member, *, nickname: str):
|
||||
guild_id = ctx.guild.id
|
||||
@@ -597,7 +597,7 @@ class Global(commands.Cog):
|
||||
|
||||
self.client.loop.create_task(monitor_nickname())
|
||||
|
||||
@commands.command(name="unfreezenick", help="Unfreezes a member's nickname in the current server.")
|
||||
@commands.hybrid_command(name="unfreezenick", help="Unfreezes a member's nickname in the current server.")
|
||||
@commands.has_permissions(manage_nicknames=True)
|
||||
async def unfreeze_nickname(self, ctx: commands.Context, member: Member):
|
||||
guild_id = ctx.guild.id
|
||||
|
||||
Reference in New Issue
Block a user