fix: rename command aliases to avoid collision
- /edit-emoji now uses alias 'edit' only - /rename now uses alias 'rename-emoji' only - Fixes: 'The command rename is already an existing command or alias' error
This commit is contained in:
parent
087fea31b0
commit
1b08e58aa0
@ -87,7 +87,7 @@ class AdminCog(Cog):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
await ctx.send(f"Error deleting emoji: {e}")
|
await ctx.send(f"Error deleting emoji: {e}")
|
||||||
|
|
||||||
@commands.command(name="edit-emoji", aliases=["rename", "edit"])
|
@commands.command(name="edit-emoji", aliases=["edit"])
|
||||||
@commands.has_permissions(manage_emojis_and_stickers=True)
|
@commands.has_permissions(manage_emojis_and_stickers=True)
|
||||||
async def edit_emoji(self, ctx: Context, *, name: str) -> None:
|
async def edit_emoji(self, ctx: Context, *, name: str) -> None:
|
||||||
"""Edit an emoji's name or image."""
|
"""Edit an emoji's name or image."""
|
||||||
@ -111,13 +111,13 @@ class AdminCog(Cog):
|
|||||||
await ctx.send(f"Emoji `{name}` not found.")
|
await ctx.send(f"Emoji `{name}` not found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await ctx.send(f"Emoji `{name}` found.\nUse `/rename` to change the name.")
|
await ctx.send(f"Emoji `{name}` found.\nUse `/delete` to delete it.")
|
||||||
except discord.NotFound:
|
except discord.NotFound:
|
||||||
await ctx.send(f"Emoji `{name}` not found.")
|
await ctx.send(f"Emoji `{name}` not found.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await ctx.send(f"Error: {e}")
|
await ctx.send(f"Error: {e}")
|
||||||
|
|
||||||
@commands.command(name="rename", aliases=["edit"])
|
@commands.command(name="rename", aliases=["rename-emoji"])
|
||||||
@commands.has_permissions(manage_emojis_and_stickers=True)
|
@commands.has_permissions(manage_emojis_and_stickers=True)
|
||||||
async def rename(self, ctx: Context, *, name: str) -> None:
|
async def rename(self, ctx: Context, *, name: str) -> None:
|
||||||
"""Rename an emoji."""
|
"""Rename an emoji."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user