Parser fix
This commit is contained in:
1 parent
604de30345
commit
d58a3c7e93
2 files changed
+14
-2
No files matched your search
@@ -47,6 +47,8 @@ class VkError(RuntimeError):
|
||||
|
||||
|
||||
def _person(value: str) -> tuple[str, int]:
|
||||
# Users often copy the example sentence together with its final period.
|
||||
value = value.strip().rstrip(".!?").strip()
|
||||
match = _PERSON_RE.fullmatch(value)
|
||||
if not match:
|
||||
raise ValueError("Укажите имя и ID в формате Имя [12345]")
|
||||
|
||||
Reference in new issue
Block a user