mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update docs
This commit is contained in:
parent
7c65344dcd
commit
7b33e5c68a
8 changed files with 55 additions and 38 deletions
|
|
@ -5,9 +5,9 @@ This module has mongo storage for finite-state machine
|
|||
|
||||
from typing import Union, Dict, Optional, List, Tuple, AnyStr
|
||||
|
||||
import pymongo
|
||||
|
||||
try:
|
||||
import pymongo
|
||||
import motor
|
||||
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase
|
||||
except ModuleNotFoundError as e:
|
||||
|
|
@ -26,6 +26,7 @@ COLLECTIONS = (STATE, DATA, BUCKET)
|
|||
class MongoStorage(BaseStorage):
|
||||
"""
|
||||
Mongo-based storage for FSM.
|
||||
|
||||
Usage:
|
||||
|
||||
.. code-block:: python3
|
||||
|
|
@ -39,7 +40,6 @@ class MongoStorage(BaseStorage):
|
|||
|
||||
await dp.storage.close()
|
||||
await dp.storage.wait_closed()
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, host='localhost', port=27017, db_name='aiogram_fsm', uri=None,
|
||||
|
|
|
|||
|
|
@ -19,16 +19,17 @@ class RethinkDBStorage(BaseStorage):
|
|||
|
||||
Usage:
|
||||
|
||||
..code-block:: python3
|
||||
.. code-block:: python3
|
||||
|
||||
storage = RethinkDBStorage(db='aiogram', table='aiogram', user='aiogram', password='aiogram_secret')
|
||||
dispatcher = Dispatcher(bot, storage=storage)
|
||||
|
||||
And need to close connection when shutdown
|
||||
|
||||
..code-clock:: python3
|
||||
.. code-block:: python3
|
||||
|
||||
await storage.close()
|
||||
await storage.wait_closed()
|
||||
|
||||
"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue