Skip to content

Commit fe4e8c5

Browse files
committed
Rename get_history's "reversed" parameter to "reverse"
It was colliding with the built-in "reversed" function
1 parent 36f987e commit fe4e8c5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pyrogram/client/methods/messages/get_history.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_history(self,
3030
offset: int = 0,
3131
offset_id: int = 0,
3232
offset_date: int = 0,
33-
reversed: bool = False):
33+
reverse: bool = False):
3434
"""Use this method to retrieve the history of a chat.
3535
3636
You can get up to 100 messages at once.
@@ -55,7 +55,7 @@ def get_history(self,
5555
offset_date (``int``, *optional*):
5656
Pass a date in Unix time as offset to retrieve only older messages starting from that date.
5757
58-
reversed (``bool``, *optional*):
58+
reverse (``bool``, *optional*):
5959
Pass True to retrieve the messages in reversed order (from older to most recent).
6060
6161
Returns:
@@ -72,7 +72,7 @@ def get_history(self,
7272
peer=self.resolve_peer(chat_id),
7373
offset_id=offset_id,
7474
offset_date=offset_date,
75-
add_offset=offset - (limit if reversed else 0),
75+
add_offset=offset - (limit if reverse else 0),
7676
limit=limit,
7777
max_id=0,
7878
min_id=0,
@@ -81,7 +81,7 @@ def get_history(self,
8181
)
8282
)
8383

84-
if reversed:
84+
if reverse:
8585
messages.messages.reverse()
8686

8787
return messages

0 commit comments

Comments
 (0)