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

Field usernames are missed in objects User, Chat, Channel #1252

Open
3 tasks done
hittiks opened this issue Apr 7, 2023 · 0 comments · May be fixed by #1257
Open
3 tasks done

Field usernames are missed in objects User, Chat, Channel #1252

hittiks opened this issue Apr 7, 2023 · 0 comments · May be fixed by #1257

Comments

@hittiks
Copy link

hittiks commented Apr 7, 2023

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/master.zip and reproduced the issue using the latest development version

Description

When get user/chat with multiple usernames, pyrogram get raw object with empty field username and with not empty field usernames but ignore second field when parse to User object

Steps to reproduce

Try get user with multiple usernames by him main username (other will raise KeyError, see #1239)

Code example

user = await cl.get_users("shadowraze")
print(user)

Logs

{
    "_": "User",
    "id": 5825705556,
    "is_self": false,
    "is_contact": false,
    "is_mutual_contact": false,
    "is_deleted": false,
    "is_bot": false,
    "is_verified": false,
    "is_restricted": false,
    "is_scam": false,
    "is_fake": false,
    "is_support": false,
    "is_premium": true,
    "first_name": "ytn",
    "status": "UserStatus.RECENTLY",
    "phone_number": "*********"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant