2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-30 13:57:54 +00:00

Allow unlimited replies to be fetched with get_messages

This commit is contained in:
Dan 2019-05-08 16:01:03 +02:00
parent 692befe038
commit 920f8ff911

View File

@ -55,7 +55,9 @@ class GetMessages(BaseClient):
If *message_ids* is set, this argument will be ignored.
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:
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 = [ids_type(id=i) for i in ids]
if replies < 0:
replies = (1 << 31) - 1
if isinstance(peer, types.InputPeerChannel):
rpc = functions.channels.GetMessages(channel=peer, id=ids)
else: