From 20193404e8cbdf9f1f908058b8d03be578a439e6 Mon Sep 17 00:00:00 2001 From: TheOnlyMace <0815cracky@gmail.com> Date: Tue, 21 Jul 2026 22:47:29 +0200 Subject: [PATCH] Refactor command definitions in owner and moderation cogs for consistency. Change `getinvite` command to a regular command and update type hints for parameters in `enlarge` and `roleicon` commands to improve clarity and type safety. --- bot/cogs/commands/owner.py | 4 ++-- bot/cogs/commands/owner2.py | 2 +- bot/cogs/moderation/moderation.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/cogs/commands/owner.py b/bot/cogs/commands/owner.py index f45c1b1..bb25e0f 100644 --- a/bot/cogs/commands/owner.py +++ b/bot/cogs/commands/owner.py @@ -237,9 +237,9 @@ class Owner(commands.Cog): ctx=ctx) await paginator.paginate() - @commands.hybrid_command(name="getinvite", aliases=["gi", "guildinvite"]) + @commands.command(name="getinvite", aliases=["gi", "guildinvite"]) @commands.is_owner() - async def getinvite(self, ctx: Context, guild= discord.Guild): + async def getinvite(self, ctx: Context, guild: discord.Guild): if not guild: await ctx.send("Invalid server.") return diff --git a/bot/cogs/commands/owner2.py b/bot/cogs/commands/owner2.py index 2635fdc..555559a 100644 --- a/bot/cogs/commands/owner2.py +++ b/bot/cogs/commands/owner2.py @@ -32,7 +32,7 @@ class Global(commands.Cog): await ctx.send_help(ctx.command) ctx.command.reset_cooldown(ctx) - @commands.hybrid_command(name="GB",help="Bans the user from all mutual guilds.") + @commands.hybrid_command(name="gb", aliases=["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)] diff --git a/bot/cogs/moderation/moderation.py b/bot/cogs/moderation/moderation.py index 361126f..5e5781c 100644 --- a/bot/cogs/moderation/moderation.py +++ b/bot/cogs/moderation/moderation.py @@ -119,7 +119,7 @@ class Moderation(commands.Cog): @blacklist_check() @ignore_check() @commands.cooldown(1, 3, commands.BucketType.user) - async def enlarge(self, ctx, emoji: Union[discord.Emoji, discord.PartialEmoji, str]): + async def enlarge(self, ctx, emoji: str): url = emoji.url await ctx.send(url) @@ -870,7 +870,7 @@ class Moderation(commands.Cog): @commands.cooldown(1, 3, commands.BucketType.user) @commands.has_permissions(administrator=True) @commands.bot_has_guild_permissions(manage_roles=True) - async def roleicon(self, ctx: commands.Context, role: discord.Role, *, icon: Union[discord.Emoji, discord.PartialEmoji, str] = None): + async def roleicon(self, ctx: commands.Context, role: discord.Role, *, icon: str = None): if role.position >= ctx.guild.me.top_role.position: error_embed = discord.Embed(