Don't use deprecated Bot.close method from dispatcher (Replaced by session.close)

This commit is contained in:
Alex Root Junior 2020-11-08 00:02:39 +02:00
parent f38d42c0a0
commit c12a76e8c0
2 changed files with 2 additions and 2 deletions

View file

@ -175,7 +175,7 @@ class BaseBot:
self._ctx_token.reset(token)
@deprecated("This method's behavior will be changed in aiogram v3.0. "
"More info: https://core.telegram.org/bots/api#close")
"More info: https://core.telegram.org/bots/api#close", stacklevel=3)
async def close(self):
"""
Close all client sessions

View file

@ -354,7 +354,7 @@ class Executor:
self.dispatcher.stop_polling()
await self.dispatcher.storage.close()
await self.dispatcher.storage.wait_closed()
await self.dispatcher.bot.close()
await self.dispatcher.bot.session.close()
async def _startup_polling(self):
await self._welcome()