From 608d908bc8a8ef7bb073d72d415039f3b5f34dfe Mon Sep 17 00:00:00 2001 From: uburuntu Date: Wed, 28 Jul 2021 19:51:00 +0300 Subject: [PATCH] enh: implement all abstract methods for DisabledStorage --- aiogram/dispatcher/storage.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/aiogram/dispatcher/storage.py b/aiogram/dispatcher/storage.py index eb248e34..340b6352 100644 --- a/aiogram/dispatcher/storage.py +++ b/aiogram/dispatcher/storage.py @@ -461,7 +461,6 @@ class DisabledStorage(BaseStorage): """ Empty storage. Use it if you don't want to use Finite-State Machine """ - async def close(self): pass @@ -499,6 +498,25 @@ class DisabledStorage(BaseStorage): data: typing.Dict = None): self._warn() + async def get_bucket(self, *, + chat: typing.Union[str, int, None] = None, + user: typing.Union[str, int, None] = None, + default: typing.Optional[dict] = None) -> typing.Dict: + self._warn() + return {} + + async def set_bucket(self, *, + chat: typing.Union[str, int, None] = None, + user: typing.Union[str, int, None] = None, + bucket: typing.Dict = None): + self._warn() + + async def update_bucket(self, *, + chat: typing.Union[str, int, None] = None, + user: typing.Union[str, int, None] = None, + bucket: typing.Dict = None, **kwargs): + self._warn() + @staticmethod def _warn(): warn(f"You haven’t set any storage yet so no states and no data will be saved. \n"