From edf325d58071892f8670b8c0b68ea97e2f27fb1d Mon Sep 17 00:00:00 2001 From: Birger Jarl Date: Thu, 7 Sep 2017 10:41:49 +0300 Subject: [PATCH] Fix username regex (#235) Username max length is 1+31 = 32 --- telethon/errors/rpc_errors_400.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/errors/rpc_errors_400.py b/telethon/errors/rpc_errors_400.py index 32591bb5..216910c8 100644 --- a/telethon/errors/rpc_errors_400.py +++ b/telethon/errors/rpc_errors_400.py @@ -284,7 +284,7 @@ class UsernameInvalidError(BadRequestError): def __init__(self, **kwargs): super(Exception, self).__init__( self, - 'Unacceptable username. Must match r"[a-zA-Z][\w\d]{4,32}"' + 'Unacceptable username. Must match r"[a-zA-Z][\w\d]{4,31}"' )