Skip to content

Commit 97980a2

Browse files
committed
another attempt to fix get_forum_topics method
Ref: Mayuri-Chan/pyrofork@7db5e14
1 parent fe83e15 commit 97980a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyrogram/methods/chat_topics/get_forum_topics.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ async def get_forum_topics(
9191

9292
users = {i.id: i for i in r.users}
9393
chats = {i.id: i for i in r.chats}
94+
tts = getattr(r, "topics", [])
95+
if not tts:
96+
return
9497
messages = {}
9598

9699
for message in getattr(r, "messages", []):
@@ -107,7 +110,7 @@ async def get_forum_topics(
107110

108111
topics = []
109112

110-
for topic in getattr(r, "topics", []):
113+
for topic in tts:
111114
topics.append(
112115
types.ForumTopic._parse(
113116
self, topic, messages, users, chats

0 commit comments

Comments
 (0)