mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-06 07:14:50 +00:00
Merge pull request #51 from eyMarv/patch-3
Fix sender retrieval of Story() object
This commit is contained in:
commit
dc4d6ce9b5
1 changed files with 7 additions and 2 deletions
|
|
@ -230,8 +230,13 @@ class Story(Object, Update):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if stories.from_id is not None:
|
if stories.from_id is not None:
|
||||||
from_user = await client.get_users(stories.from_id.user_id)
|
if getattr(stories.from_id, "user_id", None) is not None:
|
||||||
chat = types.Chat._parse_chat(client, chat.chats[0])
|
from_user = await client.get_users(stories.from_id.user_id)
|
||||||
|
chat = types.Chat._parse_chat(client, chat.chats[0])
|
||||||
|
elif getattr(stories.from_id, "channel_id", None) is not None:
|
||||||
|
sender_chat = types.Chat._parse_chat(client, stories.from_id.channel_id)
|
||||||
|
elif getattr(stories.from_id, "chat_id", None) is not None:
|
||||||
|
sender_chat = types.Chat._parse_chat(client, stories.from_id.chat_id)
|
||||||
else:
|
else:
|
||||||
sender_chat = types.Chat._parse_chat(client, chat.chats[0])
|
sender_chat = types.Chat._parse_chat(client, chat.chats[0])
|
||||||
elif isinstance(peer, raw.types.InputPeerSelf):
|
elif isinstance(peer, raw.types.InputPeerSelf):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue