mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Bugfixes in chat.py (#411)
- Fixed this bug: https://t.me/pyrogramchat/169553 (which was caused because pyrogram trying to parse linked_chat even if it was None). - Fixed another related bug (which was caused because pyrogram trying to get linked_chat_id even with basic groups causing an AttributeError).
This commit is contained in:
parent
d5a18eb063
commit
d93b9275f3
@ -251,9 +251,10 @@ class Chat(Object):
|
||||
for c in chat_full.chats:
|
||||
if full_chat.id == c.id:
|
||||
chat = c
|
||||
|
||||
if full_chat.linked_chat_id == c.id:
|
||||
linked_chat = c
|
||||
|
||||
if isinstance(chat_full, types.ChannelFull):
|
||||
if full_chat.linked_chat_id == c.id:
|
||||
linked_chat = c
|
||||
|
||||
if isinstance(full_chat, types.ChatFull):
|
||||
parsed_chat = Chat._parse_chat_chat(client, chat)
|
||||
@ -268,7 +269,8 @@ class Chat(Object):
|
||||
# TODO: Add StickerSet type
|
||||
parsed_chat.can_set_sticker_set = full_chat.can_set_stickers
|
||||
parsed_chat.sticker_set_name = getattr(full_chat.stickerset, "short_name", None)
|
||||
parsed_chat.linked_chat = Chat._parse_channel_chat(client, linked_chat)
|
||||
if linked_chat:
|
||||
parsed_chat.linked_chat = Chat._parse_channel_chat(client, linked_chat)
|
||||
|
||||
if full_chat.pinned_msg_id:
|
||||
parsed_chat.pinned_message = client.get_messages(
|
||||
|
Loading…
Reference in New Issue
Block a user