1 parent 04542db commit fbc18caCopy full SHA for fbc18ca
1 file changed
pyrogram/client/methods/messages/get_history.py
@@ -31,9 +31,10 @@ def get_history(self,
31
offset_id: int = 0,
32
offset_date: int = 0,
33
reverse: bool = False):
34
- """Use this method to retrieve the history of a chat.
+ """Use this method to retrieve a chunk of the history of a chat.
35
36
You can get up to 100 messages at once.
37
+ For a more convenient way of getting a chat history see :meth:`iter_history`.
38
39
Args:
40
chat_id (``int`` | ``str``):
@@ -72,7 +73,7 @@ def get_history(self,
72
73
peer=self.resolve_peer(chat_id),
74
offset_id=offset_id,
75
offset_date=offset_date,
- add_offset=offset - (limit if reverse else 0),
76
+ add_offset=offset * (-1 if reverse else 1) - (limit if reverse else 0),
77
limit=limit,
78
max_id=0,
79
min_id=0,
0 commit comments