Visitar URL original
fix(chats): ignore ForumTopicDeleted objects in get_forum_topics by txltedxgod · Pull Request #82 · hydrogram/hydrogram · GitHub
Skip to content

fix(chats): ignore ForumTopicDeleted objects in get_forum_topics - #82

Open
txltedxgod wants to merge 1 commit into
hydrogram:devfrom
txltedxgod:fix/issue-71-ignore-deleted-forum-topics
Open

txltedxgod wants to merge 1 commit into
hydrogram:devfrom
txltedxgod:fix/issue-71-ignore-deleted-forum-topics

Conversation

@txltedxgod

Copy link
Copy Markdown

Summary

Closes #71.

When retrieving forum topics from a chat that contains deleted topics, Telegram returns raw.types.ForumTopicDeleted alongside raw.types.ForumTopic in r.topics. Calling types.ForumTopic._parse(topic) on ForumTopicDeleted raises AttributeError: 'ForumTopicDeleted' object has no attribute 'from_id'.

Changes:

  • Added isinstance(topic, raw.types.ForumTopic) check before parsing in get_forum_topics, safely ignoring deleted topic placeholders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_forum_topics crashes on ForumTopicDeleted objects

1 participant