mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Only verify if context menus pass a length check
According to Discord this is the check that is actually done
This commit is contained in:
parent
daeb0afe61
commit
0a7eb6b021
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user