From b920fe9325f30402884ad6877c0710974f937e02 Mon Sep 17 00:00:00 2001 From: wonkagrid Date: Mon, 1 Apr 2024 12:31:04 +0300 Subject: [PATCH] Add function get_value to FSMContext --- aiogram/fsm/context.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aiogram/fsm/context.py b/aiogram/fsm/context.py index 53a8ea46..bc5942ee 100644 --- a/aiogram/fsm/context.py +++ b/aiogram/fsm/context.py @@ -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]: