mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
prevent abuse cases with qualname length (#3223)
This commit is contained in:
parent
8b18526f46
commit
ef99174585
1
changelog.d/3223.misc.rst
Normal file
1
changelog.d/3223.misc.rst
Normal file
@ -0,0 +1 @@
|
||||
qualified command names are limited to a maximum of 60 characters
|
||||
@ -167,6 +167,11 @@ class Command(CogCommandMixin, commands.Command):
|
||||
raise RuntimeError(
|
||||
f"The name `{name}` cannot be set as a command name. It is reserved for internal use."
|
||||
)
|
||||
if len(self.qualified_name) > 60:
|
||||
raise RuntimeError(
|
||||
f"This command ({self.qualified_name}) has an excessively long qualified name, "
|
||||
"and will not be added to the bot to prevent breaking tools and menus. (limit 60)"
|
||||
)
|
||||
|
||||
def _ensure_assignment_on_copy(self, other):
|
||||
super()._ensure_assignment_on_copy(other)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user