mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
Pyrofork: fix get_chat exception when personal_channel_id is None
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
2d090a6db5
commit
756a42c595
1 changed files with 7 additions and 5 deletions
|
|
@ -426,12 +426,14 @@ class Chat(Object):
|
|||
parsed_chat.business_info = types.BusinessInfo._parse(client, full_user, users)
|
||||
birthday = getattr(full_user, "birthday", None)
|
||||
parsed_chat.birthday = types.Birthday._parse(birthday) if birthday is not None else None
|
||||
personal_chat = await client.invoke(
|
||||
raw.functions.channels.GetChannels(
|
||||
id=[await client.resolve_peer(utils.get_channel_id(full_user.personal_channel_id))]
|
||||
personal_chat_id = getattr(full_user, "personal_channel_id", None)
|
||||
if personal_chat_id is not None:
|
||||
personal_chat = await client.invoke(
|
||||
raw.functions.channels.GetChannels(
|
||||
id=[await client.resolve_peer(utils.get_channel_id(personal_chat_id))]
|
||||
)
|
||||
)
|
||||
)
|
||||
parsed_chat.personal_chat = Chat._parse_chat(client, personal_chat.chats[0])
|
||||
parsed_chat.personal_chat = Chat._parse_chat(client, personal_chat.chats[0])
|
||||
|
||||
if full_user.pinned_msg_id:
|
||||
parsed_chat.pinned_message = await client.get_messages(
|
||||
|
|
|
|||
Loading…
Reference in a new issue