From 0ec612d71a71536b5a0072ef5f5f1602a64ad35a Mon Sep 17 00:00:00 2001 From: "Dmitry D. Chernov" Date: Tue, 31 Mar 2020 19:18:57 +1000 Subject: [PATCH] utils: Style fix and simplify a bit the VALID_USERNAME_RE --- telethon/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/utils.py b/telethon/utils.py index 0c63d143..74f90011 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -64,7 +64,7 @@ TG_JOIN_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){3,30}[a-z\d]' r'|gif|vid|pic|bing|wiki|imdb|bold|vote|like|coub)$', re.IGNORECASE )