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
9ee3afb819
commit
1906bc2939
6 changed files with 25 additions and 3 deletions
|
|
@ -498,7 +498,6 @@ def pyrogram_api():
|
||||||
Pyromod
|
Pyromod
|
||||||
Identifier
|
Identifier
|
||||||
Listener
|
Listener
|
||||||
ListenerTypes
|
|
||||||
""",
|
""",
|
||||||
bot_keyboards="""
|
bot_keyboards="""
|
||||||
Bot keyboards
|
Bot keyboards
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ to apply only a valid value among the expected ones.
|
||||||
ChatMemberStatus
|
ChatMemberStatus
|
||||||
ChatMembersFilter
|
ChatMembersFilter
|
||||||
ChatType
|
ChatType
|
||||||
|
ListenerTypes
|
||||||
MessageEntityType
|
MessageEntityType
|
||||||
MessageMediaType
|
MessageMediaType
|
||||||
MessageServiceType
|
MessageServiceType
|
||||||
|
|
@ -38,6 +39,7 @@ to apply only a valid value among the expected ones.
|
||||||
ChatMemberStatus
|
ChatMemberStatus
|
||||||
ChatMembersFilter
|
ChatMembersFilter
|
||||||
ChatType
|
ChatType
|
||||||
|
ListenerTypes
|
||||||
MessageEntityType
|
MessageEntityType
|
||||||
MessageMediaType
|
MessageMediaType
|
||||||
MessageServiceType
|
MessageServiceType
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,6 @@ Meta
|
||||||
|
|
||||||
faq/index
|
faq/index
|
||||||
support
|
support
|
||||||
releases/index
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:hidden:
|
:hidden:
|
||||||
|
|
|
||||||
|
|
@ -68,21 +68,27 @@ In case you want to have persistent session but you don't have persistent storag
|
||||||
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())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,21 +40,29 @@ class WaitForCallbackQuery:
|
||||||
Parameters:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
Unique identifier (int) or username (str) of the target chat.
|
Unique identifier (int) or username (str) of the target chat.
|
||||||
|
|
||||||
filters (:obj:`Filters`):
|
filters (:obj:`Filters`):
|
||||||
Pass one or more filters to allow only a subset of callback queries to be passed
|
Pass one or more filters to allow only a subset of callback queries to be passed
|
||||||
in your callback function.
|
in your callback function.
|
||||||
|
|
||||||
timeout (``int``, *optional*):
|
timeout (``int``, *optional*):
|
||||||
Timeout in seconds.
|
Timeout in seconds.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`~pyrogram.types.CallbackQuery`: On success, the callback query is returned.
|
:obj:`~pyrogram.types.CallbackQuery`: On success, the callback query is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
asyncio.TimeoutError: In case callback query not received within the timeout.
|
asyncio.TimeoutError: In case callback query not received within the timeout.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# Simple example
|
# Simple example
|
||||||
callback_query = app.wait_for_callback_query(chat_id)
|
callback_query = app.wait_for_callback_query(chat_id)
|
||||||
|
|
||||||
# Example with filter
|
# Example with filter
|
||||||
callback_query = app.wait_for_callback_query(chat_id, filters=filters.user(user_id))
|
callback_query = app.wait_for_callback_query(chat_id, filters=filters.user(user_id))
|
||||||
|
|
||||||
# Example with timeout
|
# Example with timeout
|
||||||
callback_query = app.wait_for_callback_query(chat_id, timeout=60)
|
callback_query = app.wait_for_callback_query(chat_id, timeout=60)
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -39,21 +39,29 @@ class WaitForMessage:
|
||||||
Parameters:
|
Parameters:
|
||||||
chat_id (``int`` | ``str``):
|
chat_id (``int`` | ``str``):
|
||||||
Unique identifier (int) or username (str) of the target chat.
|
Unique identifier (int) or username (str) of the target chat.
|
||||||
|
|
||||||
filters (:obj:`Filters`):
|
filters (:obj:`Filters`):
|
||||||
Pass one or more filters to allow only a subset of callback queries to be passed
|
Pass one or more filters to allow only a subset of callback queries to be passed
|
||||||
in your callback function.
|
in your callback function.
|
||||||
|
|
||||||
timeout (``int``, *optional*):
|
timeout (``int``, *optional*):
|
||||||
Timeout in seconds.
|
Timeout in seconds.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
:obj:`~pyrogram.types.Message`: On success, the reply message is returned.
|
:obj:`~pyrogram.types.Message`: On success, the reply message is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
asyncio.TimeoutError: In case message not received within the timeout.
|
asyncio.TimeoutError: In case message not received within the timeout.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# Simple example
|
# Simple example
|
||||||
reply_message = app.wait_for_message(chat_id)
|
reply_message = app.wait_for_message(chat_id)
|
||||||
|
|
||||||
# Example with filter
|
# Example with filter
|
||||||
reply_message = app.wait_for_message(chat_id, filters=filters.text)
|
reply_message = app.wait_for_message(chat_id, filters=filters.text)
|
||||||
|
|
||||||
# Example with timeout
|
# Example with timeout
|
||||||
reply_message = app.wait_for_message(chat_id, timeout=60)
|
reply_message = app.wait_for_message(chat_id, timeout=60)
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue