From f5d008938f9ecfd55f694293f565cc9962a15ba4 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Sat, 23 Nov 2019 11:46:50 +0300 Subject: [PATCH] #239 added check for right part of token exists; removed check for left part length --- aiogram/bot/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/bot/api.py b/aiogram/bot/api.py index 675626ac..9dea86ea 100644 --- a/aiogram/bot/api.py +++ b/aiogram/bot/api.py @@ -28,7 +28,7 @@ def check_token(token: str) -> bool: raise exceptions.ValidationError('Token is invalid!') left, sep, right = token.partition(':') - if (not sep) or (not left.isdigit()) or (len(left) < 3): + if (not sep) or (not left.isdigit()) or (not right): raise exceptions.ValidationError('Token is invalid!') return True