From 45afaa8ec8b0ed765a801e12824b0fd653ab6d9d Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Thu, 28 May 2020 23:50:44 +0200 Subject: [PATCH] Make the checks in `[p]alias global add` and `[p]alias add` consistent (#3797) --- redbot/cogs/alias/alias.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/redbot/cogs/alias/alias.py b/redbot/cogs/alias/alias.py index d95bc2ace..937611124 100644 --- a/redbot/cogs/alias/alias.py +++ b/redbot/cogs/alias/alias.py @@ -157,7 +157,7 @@ class Alias(commands.Cog): _( "You attempted to create a new alias" " with the name {name} but that" - " alias already exists on this server." + " alias already exists." ).format(name=alias_name) ) return @@ -210,13 +210,13 @@ class Alias(commands.Cog): ) return - alias = await self._aliases.get_alias(ctx.guild, alias_name) + alias = await self._aliases.get_alias(None, alias_name) if alias: await ctx.send( _( "You attempted to create a new global alias" " with the name {name} but that" - " alias already exists on this server." + " alias already exists." ).format(name=alias_name) ) return @@ -232,6 +232,13 @@ class Alias(commands.Cog): ).format(name=alias_name) ) return + + given_command_exists = self.bot.get_command(command.split(maxsplit=1)[0]) is not None + if not given_command_exists: + await ctx.send( + _("You attempted to create a new alias for a command that doesn't exist.") + ) + return # endregion try: