diff --git a/telethon/client/messages.py b/telethon/client/messages.py index cda410d1..24ec8c92 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -1277,7 +1277,8 @@ class MessageMethods: message: 'typing.Union[hints.MessageIDLike, typing.Sequence[hints.MessageIDLike]]' = None, *, max_id: int = None, - clear_mentions: bool = False) -> bool: + clear_mentions: bool = False, + clear_reactions: bool = False) -> bool: """ Marks messages as read and optionally clears mentions. @@ -1311,6 +1312,13 @@ class MessageMethods: If no message is provided, this will be the only action taken. + clear_reactions (`bool`): + Whether the reactions badge should be cleared (so that + there are no more reaction notifications) or not for the given entity. + + If no message is provided, this will be the only action + taken. + Example .. code-block:: python @@ -1333,6 +1341,10 @@ class MessageMethods: entity = await self.get_input_entity(entity) if clear_mentions: await self(functions.messages.ReadMentionsRequest(entity)) + if max_id is None and not clear_reactions: + return True + if clear_reactions: + await self(functions.messages.ReadReactionsRequest(entity)) if max_id is None: return True