mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
enh: implement all abstract methods for DisabledStorage
This commit is contained in:
parent
cd2e1889de
commit
608d908bc8
1 changed files with 19 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue