send_read_acknowledge doesn't work for megagroup
VYBIG opened this issue · comments
Code that causes the issue
@client.on(events.NewMessage(incoming=True))
async def mark_archived_dialogs_as_read(event):
async for dialog in client.iter_dialogs(archived=True):
if event.message.message == dialog.message.message:
if isinstance(event.peer_id, types.PeerChat):
await client.send_read_acknowledge(entity=event.message.peer_id.chat_id,
max_id=event.message.id,
clear_mentions=True,
clear_reactions=True,
)
elif isinstance(event.peer_id, types.PeerChannel):
await client.send_read_acknowledge(entity=event.message.peer_id.channel_id,
max_id=event.message.id,
clear_mentions=True,
clear_reactions=True,
)
Expected behavior
I have some function for marking archived dialogs as read in my telegram account, it is marking archived dialogs as read, if it is common group
Actual behavior
This function work for common groups, but doesn't work for mega groups and there is no any error message
Traceback
No response
Telethon version
1.35.0
Python version
3.11
Operating system (including distribution name and version)
any
Other details
No response
Checklist
- The error is in the library's code, and not in my own.
- I have searched for this issue before posting it and there isn't an open duplicate.
- I ran
pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip
and triggered the bug in the latest version.
If you believe the implementation is wrong, please call the raw API directly, and let me know what the correct method and parameters are:
Telethon/telethon/client/messages.py
Line 1310 in 4767368
As far as I can see, the implementation for both is almost identical. So I will close this assuming the problem is Telegram's, not Telethon's.