mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Pyrogram: utils: Check if messages has topics atribut
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
b76bf48862
commit
e38ceb08cc
1 changed files with 4 additions and 1 deletions
|
|
@ -91,7 +91,10 @@ async def parse_messages(
|
|||
) -> List["types.Message"]:
|
||||
users = {i.id: i for i in messages.users}
|
||||
chats = {i.id: i for i in messages.chats}
|
||||
topics = {i.id: i for i in messages.topics}
|
||||
if hasattr(messages, "topics"):
|
||||
topics = {i.id: i for i in messages.topics}
|
||||
else:
|
||||
topics = None
|
||||
if not messages.messages:
|
||||
return types.List()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue