Update to layer 138 (#3698)

This commit is contained in:
Devesh Pal
2022-02-04 18:52:51 +05:30
committed by GitHub
parent a3a60e6dca
commit acc512683c
3 changed files with 24 additions and 9 deletions

View File

@@ -673,7 +673,8 @@ async def mark_read(
entity: 'hints.EntityLike',
message: 'hints.MessageIDLike' = None,
*,
clear_mentions: bool = False) -> bool:
clear_mentions: bool = False,
clear_reactions: bool = False) -> bool:
if not message:
max_id = 0
elif isinstance(message, int):
@@ -685,6 +686,9 @@ async def mark_read(
if clear_mentions:
await self(_tl.fn.messages.ReadMentions(entity))
if clear_reactions:
await self(_tl.fn.messages.ReadReactions(entity))
if helpers._entity_type(entity) == helpers._EntityType.CHANNEL:
return await self(_tl.fn.channels.ReadHistory(
utils.get_input_channel(entity), max_id=max_id))

View File

@@ -55,6 +55,10 @@ class Dialog:
How many mentions are currently unread in this dialog. Note that
this value won't update when new messages arrive.
unread_reactions_count (`int`):
How many reactions are currently unread in this dialog. Note that
this value won't update when new messages arrive.
draft (`Draft <telethon.tl.custom.draft.Draft>`):
The draft object in this dialog. It will not be `None`,
so you can call ``draft.set_message(...)``.
@@ -86,6 +90,7 @@ class Dialog:
self.unread_count = dialog.unread_count
self.unread_mentions_count = dialog.unread_mentions_count
self.unread_reactions_count = dialog.unread_reactions_count
self.draft = Draft(client, self.entity, self.dialog.draft)