mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-04 21:50:57 +03:00
Better behaviour for send_read_acknowledge
This commit is contained in:
parent
7e168cb4fb
commit
09b16f96fc
|
@ -725,6 +725,9 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
|||
This effectively marks a message as read (or more than one) in the
|
||||
given conversation.
|
||||
|
||||
If neither message nor maximum ID are provided, all messages will be
|
||||
marked as read by assuming that ``max_id = 0``.
|
||||
|
||||
Args:
|
||||
entity (`entity`):
|
||||
The chat where these messages are located.
|
||||
|
@ -744,14 +747,13 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
|||
taken.
|
||||
"""
|
||||
if max_id is None:
|
||||
if message:
|
||||
if not message:
|
||||
max_id = 0
|
||||
else:
|
||||
if utils.is_list_like(message):
|
||||
max_id = max(msg.id for msg in message)
|
||||
else:
|
||||
max_id = message.id
|
||||
elif not clear_mentions:
|
||||
raise ValueError(
|
||||
'Either a message list or a max_id must be provided.')
|
||||
|
||||
entity = await self.get_input_entity(entity)
|
||||
if clear_mentions:
|
||||
|
|
Loading…
Reference in New Issue
Block a user