From 4a0f23b0ea9b5eabf81abee7a2c4d78c2c8dd9f0 Mon Sep 17 00:00:00 2001 From: Neuro Assassin <42872277+NeuroAssassin@users.noreply.github.com> Date: Fri, 1 May 2020 12:32:22 -0400 Subject: [PATCH] Stop allowing spaces in custom commands names (#3816) --- redbot/cogs/customcom/customcom.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/redbot/cogs/customcom/customcom.py b/redbot/cogs/customcom/customcom.py index f237d2ec3..182e125ad 100644 --- a/redbot/cogs/customcom/customcom.py +++ b/redbot/cogs/customcom/customcom.py @@ -292,6 +292,10 @@ class CustomCommands(commands.Cog): Note: This command is interactive. """ + if any(char.isspace() for char in command): + # Haha, nice try + await ctx.send(_("Custom command names cannot have spaces in them.")) + return if command in (*self.bot.all_commands, *commands.RESERVED_COMMAND_NAMES): await ctx.send(_("There already exists a bot command with the same name.")) return @@ -317,6 +321,10 @@ class CustomCommands(commands.Cog): Example: - `[p]customcom create simple yourcommand Text you want` """ + if any(char.isspace() for char in command): + # Haha, nice try + await ctx.send(_("Custom command names cannot have spaces in them.")) + return if command in (*self.bot.all_commands, *commands.RESERVED_COMMAND_NAMES): await ctx.send(_("There already exists a bot command with the same name.")) return