mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
AIOG-T-65 old close method deprecation warn
This commit is contained in:
parent
f544fa7040
commit
84e302156a
2 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue