mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
PyroFork: fix docs
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
bf66a1e439
commit
5213ddbffa
2 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue