From c6fe65b92b9cda1b497d9895bcd8fcd2eb68988b Mon Sep 17 00:00:00 2001 From: KurimuzonAkuma Date: Mon, 18 Dec 2023 00:59:13 +0300 Subject: [PATCH] Fix read_stories in case max_id is missing --- pyrogram/methods/stories/read_stories.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pyrogram/methods/stories/read_stories.py b/pyrogram/methods/stories/read_stories.py index e067e365..2ee52b58 100644 --- a/pyrogram/methods/stories/read_stories.py +++ b/pyrogram/methods/stories/read_stories.py @@ -38,7 +38,8 @@ class ReadStories: 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. @@ -46,13 +47,16 @@ class ReadStories: 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 ) )