Rename send_read_acknowledge

This commit is contained in:
Lonami Exo 2021-10-16 14:01:56 +02:00
parent 1b15a34f69
commit 010ee0813a
5 changed files with 14 additions and 12 deletions

View File

@ -716,3 +716,5 @@ size selector for download_profile_photo and download_media is now different
still thumb because otherwise documents are weird.
keep support for explicit size instance?
renamed send_read_acknowledge. add send_read_acknowledge as alias for mark_read?

View File

@ -667,7 +667,7 @@ async def delete_messages(
return sum(r.pts_count for r in res)
async def send_read_acknowledge(
async def mark_read(
self: 'TelegramClient',
entity: 'hints.EntityLike',
message: 'typing.Union[hints.MessageIDLike, typing.Sequence[hints.MessageIDLike]]' = None,

View File

@ -2490,8 +2490,8 @@ class TelegramClient:
await client.delete_messages(chat, messages)
"""
@forward_call(messages.send_read_acknowledge)
async def send_read_acknowledge(
@forward_call(messages.mark_read)
async def mark_read(
self: 'TelegramClient',
entity: 'hints.EntityLike',
message: 'typing.Union[hints.MessageIDLike, typing.Sequence[hints.MessageIDLike]]' = None,
@ -2535,11 +2535,11 @@ class TelegramClient:
.. code-block:: python
# using a Message object
await client.send_read_acknowledge(chat, message)
await client.mark_read(chat, message)
# ...or using the int ID of a Message
await client.send_read_acknowledge(chat, message_id)
await client.mark_read(chat, message_id)
# ...or passing a list of messages to mark as read
await client.send_read_acknowledge(chat, messages)
await client.mark_read(chat, messages)
"""
@forward_call(messages.pin_message)

View File

@ -310,12 +310,12 @@ class Album(EventBuilder):
async def mark_read(self):
"""
Marks the entire album as read. Shorthand for
`client.send_read_acknowledge()
<telethon.client.messages.MessageMethods.send_read_acknowledge>`
`client.mark_read()
<telethon.client.messages.MessageMethods.mark_read>`
with both ``entity`` and ``message`` already set.
"""
if self._client:
await self._client.send_read_acknowledge(
await self._client.mark_read(
await self.get_input_chat(), max_id=self.messages[-1].id)
async def pin(self, *, notify=False):

View File

@ -1237,12 +1237,12 @@ class Message(ChatGetter, SenderGetter):
async def mark_read(self):
"""
Marks the message as read. Shorthand for
`client.send_read_acknowledge()
<telethon.client.messages.MessageMethods.send_read_acknowledge>`
`client.mark_read()
<telethon.client.messages.MessageMethods.mark_read>`
with both ``entity`` and ``message`` already set.
"""
if self._client:
await self._client.send_read_acknowledge(
await self._client.mark_read(
await self.get_input_chat(), max_id=self.id)
async def pin(self, *, notify=False, pm_oneside=False):