enh: implement all abstract methods for DisabledStorage

This commit is contained in:
uburuntu 2021-07-28 19:51:00 +03:00
parent cd2e1889de
commit 608d908bc8
No known key found for this signature in database
GPG key ID: 59E643252F903BE1

View file

@ -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 havent set any storage yet so no states and no data will be saved. \n"