From 4d1272f1d253550f057105cfbaf96f172cf81c90 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 17 Jun 2018 12:08:55 +0200 Subject: [PATCH] Fix __ is invalid in usernames (cc @Kyle2142) --- telethon/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/utils.py b/telethon/utils.py index fb558e41..ef9dc0a6 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -44,7 +44,7 @@ USERNAME_RE = re.compile( # # See https://telegram.org/blog/inline-bots#how-does-it-work VALID_USERNAME_RE = re.compile( - r'^([a-z][\w\d]{3,30}[a-z\d]' + r'^([a-z]((?!__)[\w\d]){3,30}[a-z\d]' r'|gif|vid|pic|bing|wiki|imdb|bold|vote|like|coub|ya)$', re.IGNORECASE )