mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
Stop allowing spaces in custom commands names (#3816)
This commit is contained in:
parent
aaee2d9294
commit
4a0f23b0ea
@ -292,6 +292,10 @@ class CustomCommands(commands.Cog):
|
|||||||
|
|
||||||
Note: This command is interactive.
|
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):
|
if command in (*self.bot.all_commands, *commands.RESERVED_COMMAND_NAMES):
|
||||||
await ctx.send(_("There already exists a bot command with the same name."))
|
await ctx.send(_("There already exists a bot command with the same name."))
|
||||||
return
|
return
|
||||||
@ -317,6 +321,10 @@ class CustomCommands(commands.Cog):
|
|||||||
Example:
|
Example:
|
||||||
- `[p]customcom create simple yourcommand Text you want`
|
- `[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):
|
if command in (*self.bot.all_commands, *commands.RESERVED_COMMAND_NAMES):
|
||||||
await ctx.send(_("There already exists a bot command with the same name."))
|
await ctx.send(_("There already exists a bot command with the same name."))
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user