2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-30 05:48:14 +00:00

Fix invited_by being optional

This commit is contained in:
Dan 2022-04-24 11:56:07 +02:00
parent 41f16a17c9
commit 5f2dcf70ed

View File

@ -151,7 +151,10 @@ class ChatMember(Object):
user=types.User._parse(client, users[member.user_id]),
joined_date=utils.timestamp_to_datetime(member.date),
promoted_by=types.User._parse(client, users[member.promoted_by]),
invited_by=types.User._parse(client, users[member.inviter_id]),
invited_by=(
types.User._parse(client, users[member.inviter_id])
if member.inviter_id else None
),
custom_title=member.rank,
can_be_edited=member.can_edit,
privileges=types.ChatPrivileges._parse(member.admin_rights),