mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 22:35:36 +00:00
Allow unlimited replies to be fetched with get_messages
This commit is contained in:
@@ -55,7 +55,9 @@ class GetMessages(BaseClient):
|
|||||||
If *message_ids* is set, this argument will be ignored.
|
If *message_ids* is set, this argument will be ignored.
|
||||||
|
|
||||||
replies (``int``, *optional*):
|
replies (``int``, *optional*):
|
||||||
The number of subsequent replies to get for each message. Defaults to 1.
|
The number of subsequent replies to get for each message.
|
||||||
|
Pass 0 for no reply at all or -1 for unlimited replies.
|
||||||
|
Defaults to 1.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success and in case *message_ids* or *reply_to_message_ids* was an iterable, the returned value will be a
|
On success and in case *message_ids* or *reply_to_message_ids* was an iterable, the returned value will be a
|
||||||
@@ -80,6 +82,9 @@ class GetMessages(BaseClient):
|
|||||||
ids = list(ids) if is_iterable else [ids]
|
ids = list(ids) if is_iterable else [ids]
|
||||||
ids = [ids_type(id=i) for i in ids]
|
ids = [ids_type(id=i) for i in ids]
|
||||||
|
|
||||||
|
if replies < 0:
|
||||||
|
replies = (1 << 31) - 1
|
||||||
|
|
||||||
if isinstance(peer, types.InputPeerChannel):
|
if isinstance(peer, types.InputPeerChannel):
|
||||||
rpc = functions.channels.GetMessages(channel=peer, id=ids)
|
rpc = functions.channels.GetMessages(channel=peer, id=ids)
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user