|
|
@ -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'(?<!^)(?=[A-Z])') |
|
|
|
|
|
|
|
|
|
|
@ -157,7 +156,7 @@ def validate_name(name: str) -> 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 |
|
|
|
|
|
|
|