Added inline query handler, updated CHANGELOG, added group name validator

This commit is contained in:
miloszowi
2021-10-07 19:15:53 +02:00
parent 88e8e13ff4
commit d05d0c0904
6 changed files with 78 additions and 9 deletions

View File

@@ -0,0 +1,16 @@
import re
from exception.invalidArgumentException import InvalidArgumentException
class GroupNameValidator:
@staticmethod
def validate(group: str) -> None:
group = group.lower()
if len(group) > 0 and not re.match(r"^[A-Za-z]+$", group):
raise InvalidArgumentException(re.escape('Group name must contain only letters.'))
if len(group) > 20:
raise InvalidArgumentException(re.escape(f'Group name length can not be greater than 20.'))