mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added missed type annotations
This commit is contained in:
parent
18ebe2954c
commit
d69e76307f
1 changed files with 4 additions and 4 deletions
|
|
@ -63,8 +63,8 @@ class MongoStorage(BaseStorage):
|
|||
with_destiny=with_destiny
|
||||
)
|
||||
|
||||
def _get_db_filter(self, key: StorageKey):
|
||||
db_filter = {'chat': key.chat_id, 'user': key.user_id}
|
||||
def _get_db_filter(self, key: StorageKey) -> Dict[str, Any]:
|
||||
db_filter: Dict[str, Any] = {'chat': key.chat_id, 'user': key.user_id}
|
||||
if self._with_bot_id:
|
||||
db_filter['bot_id'] = key.bot_id
|
||||
|
||||
|
|
@ -134,8 +134,8 @@ class MongoStorage(BaseStorage):
|
|||
bot: Bot,
|
||||
key: StorageKey,
|
||||
) -> Dict[str, Any]:
|
||||
result = await self._db[DATA].find_one(
|
||||
result: Optional[Dict[str, Dict[str, Any]]] = await self._db[DATA].find_one(
|
||||
filter=self._get_db_filter(key)
|
||||
)
|
||||
|
||||
return result.get('data') if result else {}
|
||||
return result.get('data', default={}) if result else {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue