mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add offset_{date,id,topic} parameters to get_forum_topics method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
71c39b8e6f
commit
fc84041397
1 changed files with 14 additions and 2 deletions
|
|
@ -32,7 +32,10 @@ class GetForumTopics:
|
||||||
async def get_forum_topics(
|
async def get_forum_topics(
|
||||||
self: "pyrogram.Client",
|
self: "pyrogram.Client",
|
||||||
chat_id: Union[int, str],
|
chat_id: Union[int, str],
|
||||||
limit: int = 0
|
limit: int = 0,
|
||||||
|
offset_date: int = 0,
|
||||||
|
offset_id: int = 0,
|
||||||
|
offset_topic: int = 0
|
||||||
) -> Optional[AsyncGenerator["types.ForumTopic", None]]:
|
) -> Optional[AsyncGenerator["types.ForumTopic", None]]:
|
||||||
"""Get one or more topic from a chat.
|
"""Get one or more topic from a chat.
|
||||||
|
|
||||||
|
|
@ -46,6 +49,15 @@ class GetForumTopics:
|
||||||
limit (``int``, *optional*):
|
limit (``int``, *optional*):
|
||||||
Limits the number of topics to be retrieved.
|
Limits the number of topics to be retrieved.
|
||||||
|
|
||||||
|
offset_date (``int``, *optional*):
|
||||||
|
Date of the last message of the last found topic.
|
||||||
|
|
||||||
|
offset_id (``int``, *optional*):
|
||||||
|
ID of the last message of the last found topic.
|
||||||
|
|
||||||
|
offset_topic (``int``, *optional*):
|
||||||
|
ID of the last found topic.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
``Generator``: On success, a generator yielding :obj:`~pyrogram.types.ForumTopic` objects is returned.
|
``Generator``: On success, a generator yielding :obj:`~pyrogram.types.ForumTopic` objects is returned.
|
||||||
|
|
||||||
|
|
@ -62,7 +74,7 @@ class GetForumTopics:
|
||||||
|
|
||||||
peer = await self.resolve_peer(chat_id)
|
peer = await self.resolve_peer(chat_id)
|
||||||
|
|
||||||
rpc = raw.functions.channels.GetForumTopics(channel=peer, offset_date=0, offset_id=0, offset_topic=0, limit=limit)
|
rpc = raw.functions.channels.GetForumTopics(channel=peer, offset_date=offset_date, offset_id=offset_id, offset_topic=offset_topic, limit=limit)
|
||||||
|
|
||||||
r = await self.invoke(rpc, sleep_threshold=-1)
|
r = await self.invoke(rpc, sleep_threshold=-1)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue