Skip to content

Commit

Permalink
Fix read_stories in case max_id is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Dec 17, 2023
1 parent 3c69429 commit c6fe65b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pyrogram/methods/stories/read_stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,25 @@ async def read_stories(
For a contact that exists in your Telegram address book you can use his phone number (str).
max_id (``int``, *optional*):
Maximum identifier of the target story to read.
The id of the last story you want to mark as read; all the stories before this one will be marked as
read as well. Defaults to 0 (mark every unread message as read).
Returns:
List of ``int``: On success, a list of read stories is returned.
Example:
.. code-block:: python
# Read stories
# Read all stories
await app.read_stories(chat_id)
# Mark stories as read only up to the given story id
await app.read_stories(chat_id, 123)
"""
r = await self.invoke(
raw.functions.stories.ReadStories(
peer=await self.resolve_peer(chat_id),
max_id=max_id
max_id=max_id or (1 << 31) - 1
)
)

Expand Down

0 comments on commit c6fe65b

Please sign in to comment.