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

AttributeError: 'MessageEmpty' object has no attribute 'to_id' #478

Open
Tenount opened this issue Aug 28, 2020 · 0 comments
Open

AttributeError: 'MessageEmpty' object has no attribute 'to_id' #478

Tenount opened this issue Aug 28, 2020 · 0 comments

Comments

@Tenount
Copy link

@Tenount Tenount commented Aug 28, 2020

Checklist

  • I am sure the error is coming from Pyrogram's code and not elsewhere.
  • I have searched in the issue tracker for similar bug reports, including closed ones.
  • I ran pip3 install -U https://github.com/pyrogram/pyrogram/archive/develop.zip and reproduced the issue using the latest development version.

Description

File pyrogram\client\methods\chats\get_dialogs.py
In get_dialogs function:

...
for message in r.messages:
    to_id = message.to_id
...

MessageEmpty type is ignored here.

It should be something like this::

...
for message in r.messages:
    if isinstance(message, types.MessageEmpty):
        continue

    to_id = message.to_id
...

Traceback

Traceback (most recent call last):
  File "main.py", line 28, in main
    for dialog in app.iter_dialogs():
  File "C:\Python36\site-packages\pyrogram\client\methods\chats\iter_dialogs.py", line 75, in iter_dialogs
    limit=limit
  File "C:\Python36\site-packages\pyrogram\client\methods\chats\get_dialogs.py", line 87, in get_dialogs
    to_id = message.to_id
AttributeError: 'MessageEmpty' object has no attribute 'to_id'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.