This commit is contained in:
Dmitriy Sergievskiy 2024-10-27 20:32:54 +02:00 committed by GitHub
commit e49142a056
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

1
CHANGES/1431.feature.rst Normal file
View file

@ -0,0 +1 @@
Added function **get_value** to **FSMContext** class method.

View file

@ -20,6 +20,9 @@ class FSMContext:
async def get_data(self) -> Dict[str, Any]:
return await self.storage.get_data(key=self.key)
async def get_value(self, value: str) -> Any:
return await self.get_data()[value]
async def update_data(
self, data: Optional[Dict[str, Any]] = None, **kwargs: Any
) -> Dict[str, Any]: