Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageRead event is not working while UpdateReadHistoryOutbox is working #4149

Open
3 tasks done
SuperMasterBlasterLaser opened this issue Jul 18, 2023 · 0 comments
Open
3 tasks done

Comments

@SuperMasterBlasterLaser
Copy link

SuperMasterBlasterLaser commented Jul 18, 2023

Code that causes the issue

Hello.

I've set simple event listener like this:

from telethon.sessions import StringSession
from telethon.sync import TelegramClient
from telethon import events

with TelegramClient(
            StringSession('my session string'),
            'app id',
            'api hash'
        ) as client:
    @client.on(events.MessageRead)
    async def handler(event):
        print(f"Received: {event.stringify()}")
    client.run_until_disconnected()

Expected behavior

MessageRead event should be caught, however it is being ignored.

Actual behavior

When I change event into Raw

@client.on(events.Raw)
async def handler(event):
    print(event.stringify)

It returns this:

UpdateReadHistoryOutbox(
        peer=PeerUser(
                user_id=000000000       # This example id, real one is different
        ),
        max_id=12,
        pts=25,
        pts_count=1
)

Which means events are being received but ignored. When I look here https://github.com/LonamiWebs/Telethon/blob/79fb1a54cb176993835ee0e83bb5af24722f8f7c/telethon/events/messageread.py#L41C48-L41C48

I can see that events.MessageRead uses UpdateReadHistoryOutbox, but it is not triggering

Traceback

No response

Telethon version

1.28.5

Python version

3.10

Operating system (including distribution name and version)

Windows 10

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant