AIOG-T-65 old close method deprecation warn

This commit is contained in:
Oleg A 2020-11-05 14:25:51 +03:00
parent f544fa7040
commit 84e302156a
2 changed files with 5 additions and 0 deletions

View file

@ -15,6 +15,7 @@ from . import api
from ..types import ParseMode, base
from ..utils import json
from ..utils.auth_widget import check_integrity
from ..utils.deprecated import deprecated
class BaseBot:
@ -173,6 +174,8 @@ class BaseBot:
finally:
self._ctx_token.reset(token)
@deprecated("This method behaviour will be changed in aiogram v3.0. "
"More info: https://core.telegram.org/bots/api#close")
async def close(self):
"""
Close all client sessions

View file

@ -7,6 +7,7 @@ import warnings
from .base import BaseBot, api
from .. import types
from ..types import base
from ..utils.deprecated import deprecated
from ..utils.mixins import DataMixin, ContextInstanceMixin
from ..utils.payload import generate_payload, prepare_arg, prepare_attachment, prepare_file
@ -194,6 +195,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
result = await self.request(api.Methods.LOG_OUT, payload)
return result
@deprecated("This method will be renamed to `close` in aiogram v3.0")
async def close_bot(self) -> base.Boolean:
"""
Use this method to close the bot instance before moving it from one local