Pyrofork: Fix docs

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-12-14 13:29:29 +07:00
parent 9ee3afb819
commit 1906bc2939
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
6 changed files with 25 additions and 3 deletions

View file

@ -498,7 +498,6 @@ def pyrogram_api():
Pyromod
Identifier
Listener
ListenerTypes
""",
bot_keyboards="""
Bot keyboards

View file

@ -18,6 +18,7 @@ to apply only a valid value among the expected ones.
ChatMemberStatus
ChatMembersFilter
ChatType
ListenerTypes
MessageEntityType
MessageMediaType
MessageServiceType
@ -38,6 +39,7 @@ to apply only a valid value among the expected ones.
ChatMemberStatus
ChatMembersFilter
ChatType
ListenerTypes
MessageEntityType
MessageMediaType
MessageServiceType

View file

@ -153,7 +153,6 @@ Meta
faq/index
support
releases/index
.. toctree::
:hidden:

View file

@ -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:
Using async_pymongo (Recommended for python3.9+):
.. code-block:: python
from async_pymongo import AsyncClient
from pyrogram import Client
conn = AsyncClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me())
Using motor:
.. code-block:: python
from motor.motor_asyncio import AsyncIOMotorClient
from pyrogram import Client
conn = AsyncIOMotorClient("mongodb://...")
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
print(await app.get_me())

View file

@ -40,21 +40,29 @@ class WaitForCallbackQuery:
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
filters (:obj:`Filters`):
Pass one or more filters to allow only a subset of callback queries to be passed
in your callback function.
timeout (``int``, *optional*):
Timeout in seconds.
Returns:
:obj:`~pyrogram.types.CallbackQuery`: On success, the callback query is returned.
Raises:
asyncio.TimeoutError: In case callback query not received within the timeout.
Example:
.. code-block:: python
# Simple example
callback_query = app.wait_for_callback_query(chat_id)
# Example with filter
callback_query = app.wait_for_callback_query(chat_id, filters=filters.user(user_id))
# Example with timeout
callback_query = app.wait_for_callback_query(chat_id, timeout=60)
"""
@ -73,4 +81,4 @@ class WaitForCallbackQuery:
)
waiter = dict(future=future, filters=filters, update_type=types.CallbackQuery)
conversation_handler.waiters[chat_id] = waiter
return await asyncio.wait_for(future, timeout=timeout)
return await asyncio.wait_for(future, timeout=timeout)

View file

@ -39,21 +39,29 @@ class WaitForMessage:
Parameters:
chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat.
filters (:obj:`Filters`):
Pass one or more filters to allow only a subset of callback queries to be passed
in your callback function.
timeout (``int``, *optional*):
Timeout in seconds.
Returns:
:obj:`~pyrogram.types.Message`: On success, the reply message is returned.
Raises:
asyncio.TimeoutError: In case message not received within the timeout.
Example:
.. code-block:: python
# Simple example
reply_message = app.wait_for_message(chat_id)
# Example with filter
reply_message = app.wait_for_message(chat_id, filters=filters.text)
# Example with timeout
reply_message = app.wait_for_message(chat_id, timeout=60)
"""