mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-16 20:23:32 +00:00
More safe token validation.
This commit is contained in:
parent
b7bba77d29
commit
d4a6df487f
1 changed files with 4 additions and 2 deletions
|
|
@ -19,7 +19,6 @@ class AIOGramBot:
|
||||||
:param loop:
|
:param loop:
|
||||||
:param connections_limit:
|
:param connections_limit:
|
||||||
"""
|
"""
|
||||||
api.check_token(token)
|
|
||||||
self.__token = token
|
self.__token = token
|
||||||
|
|
||||||
if loop is None:
|
if loop is None:
|
||||||
|
|
@ -30,8 +29,11 @@ class AIOGramBot:
|
||||||
connector=aiohttp.TCPConnector(limit=connections_limit),
|
connector=aiohttp.TCPConnector(limit=connections_limit),
|
||||||
loop=self.loop)
|
loop=self.loop)
|
||||||
|
|
||||||
|
api.check_token(token)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.session.close()
|
if self.session and not self.session.closed:
|
||||||
|
self.session.close()
|
||||||
|
|
||||||
def prepare_object(self, obj):
|
def prepare_object(self, obj):
|
||||||
obj.bot = self
|
obj.bot = self
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue