mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-16 12:07:13 +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 connections_limit:
|
||||
"""
|
||||
api.check_token(token)
|
||||
self.__token = token
|
||||
|
||||
if loop is None:
|
||||
|
|
@ -30,8 +29,11 @@ class AIOGramBot:
|
|||
connector=aiohttp.TCPConnector(limit=connections_limit),
|
||||
loop=self.loop)
|
||||
|
||||
api.check_token(token)
|
||||
|
||||
def __del__(self):
|
||||
self.session.close()
|
||||
if self.session and not self.session.closed:
|
||||
self.session.close()
|
||||
|
||||
def prepare_object(self, obj):
|
||||
obj.bot = self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue