mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
Reserves command names (#2977)
* Reserves command names - Currently, only reserving ``cancel`` - This should only impact matching command qualified names - This also checks aliases - This makes cc and alias use the new module constant with info about this - Module constant is available for use by 3rd party cogs which may dynamically create responses. * Change misleading var name * style * Thanks Flame! * Handles issues with CC
This commit is contained in:
@@ -89,8 +89,12 @@ class Alias(commands.Cog):
|
||||
return False, None
|
||||
|
||||
def is_command(self, alias_name: str) -> bool:
|
||||
"""
|
||||
The logic here is that if this returns true, the name shouldnt be used for an alias
|
||||
The function name can be changed when alias is reworked
|
||||
"""
|
||||
command = self.bot.get_command(alias_name)
|
||||
return command is not None
|
||||
return command is not None or alias_name in commands.RESERVED_COMMAND_NAMES
|
||||
|
||||
@staticmethod
|
||||
def is_valid_alias_name(alias_name: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user