From 5716cebb0fe31ab9a8bc9dbc1b91d602b3cee22e Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Mon, 30 Mar 2020 06:48:51 +0200 Subject: [PATCH] Send error in `[p]alias add` when target command doesn't exist (#3710) --- redbot/cogs/alias/alias.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/redbot/cogs/alias/alias.py b/redbot/cogs/alias/alias.py index b1af67d25..68025944d 100644 --- a/redbot/cogs/alias/alias.py +++ b/redbot/cogs/alias/alias.py @@ -279,6 +279,13 @@ class Alias(commands.Cog): ).format(name=alias_name) ) return + + given_command_exists = self.bot.get_command(command) 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 # At this point we know we need to make a new alias