
Code: Select all
class Validator:
@staticmethod
def valid_url(value):
regex = r"[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)"
print(value) # prints "https"
is_valid = re.search(regex, value)
if not is_valid:
raise ValidationError("Url inválida")
return True
@TypedSayCommand('!trails')
def on_trails(command_info, name:str, url:Validator.valid_url):
pass
#print(name)
#print(url)
i found my way around this with python but am i doing something wrong with the TypedSayCommand?