mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
More safe bot deleter
This commit is contained in:
parent
5e3df8bfec
commit
8f07b1248e
1 changed files with 1 additions and 1 deletions
|
|
@ -101,7 +101,7 @@ class BaseBot:
|
|||
self.parse_mode = parse_mode
|
||||
|
||||
def __del__(self):
|
||||
if not hasattr(self, 'loop'):
|
||||
if not hasattr(self, 'loop') or not hasattr(self, 'session'):
|
||||
return
|
||||
if self.loop.is_running():
|
||||
self.loop.create_task(self.close())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue