Skip to content

Commit

Permalink
Fix story parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Feb 4, 2025
1 parent 090f458 commit 32b0498
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyrogram/types/messages_and_media/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ async def _parse(
users.update({i.id: i for i in r.users})
chats.update({i.id: i for i in r.chats})

story = r.stories[0]
if r.stories:
story = r.stories[0]
except (ChannelPrivate, ChannelInvalid):
return Story(client=client, id=story.id, skipped=True, from_user=from_user, sender_chat=sender_chat, chat=chat)
if isinstance(story, raw.types.MessageMediaStory):
Expand All @@ -289,7 +290,8 @@ async def _parse(
users.update({i.id: i for i in r.users})
chats.update({i.id: i for i in r.chats})

story = r.stories[0]
if r.stories:
story = r.stories[0]
except (ChannelPrivate, ChannelInvalid):
pass
else:
Expand All @@ -307,7 +309,8 @@ async def _parse(
users.update({i.id: i for i in r.users})
chats.update({i.id: i for i in r.chats})

story = r.stories[0]
if r.stories:
story = r.stories[0]
except (ChannelPrivate, ChannelInvalid):
pass

Expand Down

0 comments on commit 32b0498

Please sign in to comment.