From 0a7eb6b02181e812c4ef7153473ed0dd96d0b897 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 27 Mar 2022 23:32:36 -0400 Subject: [PATCH] Only verify if context menus pass a length check According to Discord this is the check that is actually done --- discord/app_commands/commands.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/discord/app_commands/commands.py b/discord/app_commands/commands.py index 82f0f1ffa..77ee8f12e 100644 --- a/discord/app_commands/commands.py +++ b/discord/app_commands/commands.py @@ -126,7 +126,6 @@ else: CheckInputParameter = Union['Command[Any, ..., Any]', 'ContextMenu', CommandCallback, ContextMenuCallback] VALID_SLASH_COMMAND_NAME = re.compile(r'^[\w-]{1,32}$') -VALID_CONTEXT_MENU_NAME = re.compile(r'^[?!\w\s-]{1,32}$') CAMEL_CASE_REGEX = re.compile(r'(? str: def validate_context_menu_name(name: str) -> str: - if VALID_CONTEXT_MENU_NAME.match(name) is None: + if not name or len(name) > 32: raise ValueError('context menu names must be between 1-32 characters') return name