PyroFork: fix docs

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-05-23 21:44:13 +07:00
parent bf66a1e439
commit 5213ddbffa
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,3 @@
pyston_lite-autoload
sphinx sphinx
sphinx_rtd_theme==1.0.0 sphinx_rtd_theme==1.0.0
sphinx-rtd-dark-mode sphinx-rtd-dark-mode

View file

@ -67,22 +67,27 @@ Mongodb Storage
In case you want to have persistent session but you don't have persistent storage you can use mongodb storage by passing In case you want to have persistent session but you don't have persistent storage you can use mongodb storage by passing
mongodb config as ``dict`` to the ``mongodb`` parameter of the :obj:`~pyrogram.Client` constructor: mongodb config as ``dict`` to the ``mongodb`` parameter of the :obj:`~pyrogram.Client` constructor:
Using async_pymongo (Recommended for python3.9+): *Using async_pymongo (Recommended for python3.9+):*
.. code-block:: python .. code-block:: python
from async_pymongo import AsyncClient from async_pymongo import AsyncClient
from pyrogram import Client from pyrogram import Client
conn = AsyncClient("mongodb://...") conn = AsyncClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app: async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me()) print(await app.get_me())
*Using motor:*
Using motor:
.. code-block:: python .. code-block:: python
from motor.motor_asyncio import AsyncIOMotorClient from motor.motor_asyncio import AsyncIOMotorClient
from pyrogram import Client from pyrogram import Client
conn = AsyncIOMotorClient("mongodb://...") conn = AsyncIOMotorClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app: async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me()) print(await app.get_me())