Send error in [p]alias add when target command doesn't exist (#3710)

This commit is contained in:
jack1142 2020-03-30 06:48:51 +02:00 committed by GitHub
parent ff68538085
commit 5716cebb0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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